You are here

public function CommercePriceTest::providerTestInvalidValue in Commerce Migrate 8.2

Same name and namespace in other branches
  1. 3.1.x modules/commerce/tests/src/Unit/Plugin/migrate/process/commerce1/CommercePriceTest.php \Drupal\Tests\commerce_migrate_commerce\Unit\Plugin\migrate\process\commerce1\CommercePriceTest::providerTestInvalidValue()
  2. 3.0.x modules/commerce/tests/src/Unit/Plugin/migrate/process/commerce1/CommercePriceTest.php \Drupal\Tests\commerce_migrate_commerce\Unit\Plugin\migrate\process\commerce1\CommercePriceTest::providerTestInvalidValue()

Data provider for testSubstr().

File

modules/commerce/tests/src/Unit/Plugin/migrate/process/commerce1/CommercePriceTest.php, line 110

Class

CommercePriceTest
Tests the Commerce Price plugin.

Namespace

Drupal\Tests\commerce_migrate_commerce\Unit\Plugin\migrate\process\commerce1

Code

public function providerTestInvalidValue() {

  // Missing fraction_digits key.
  $tests[0]['value'] = [
    'amount' => '234',
    'currency_code' => 'NZD',
  ];

  // Missing currency_code key.
  $tests[1]['value'] = [
    'amount' => '234',
    'fraction_digits' => 0,
  ];

  // Missing amount key.
  $tests[2]['value'] = [
    'currency_code' => 'NZD',
    'fraction_digits' => 0,
  ];

  // Invalid fraction_digits.
  $tests[3]['value'] = [
    'amount' => '234',
    'currency_code' => 'NZD',
    'fraction_digits' => -1,
  ];
  $tests[4]['value'] = [];
  return $tests;
}