You are here

public function CommercePriceTest::testInvalidType in Commerce Migrate 8.2

Same name in this branch
  1. 8.2 modules/magento/tests/src/Unit/Plugin/migrate/process/CommercePriceTest.php \Drupal\Tests\commerce_migrate_magento\Unit\Plugin\migrate\process\CommercePriceTest::testInvalidType()
  2. 8.2 modules/csv_example/tests/src/Unit/Plugin/migrate/process/CommercePriceTest.php \Drupal\Tests\commerce_migrate_csv_example\Unit\Plugin\migrate\process\CommercePriceTest::testInvalidType()
  3. 8.2 modules/shopify/tests/src/Unit/Plugin/migrate/process/CommercePriceTest.php \Drupal\Tests\commerce_migrate_shopify\Unit\Plugin\migrate\process\CommercePriceTest::testInvalidType()
Same name and namespace in other branches
  1. 3.1.x modules/csv_example/tests/src/Unit/Plugin/migrate/process/CommercePriceTest.php \Drupal\Tests\commerce_migrate_csv_example\Unit\Plugin\migrate\process\CommercePriceTest::testInvalidType()
  2. 3.0.x modules/csv_example/tests/src/Unit/Plugin/migrate/process/CommercePriceTest.php \Drupal\Tests\commerce_migrate_csv_example\Unit\Plugin\migrate\process\CommercePriceTest::testInvalidType()

Tests that exception is thrown when input is not an array.

@dataProvider providerTestInvalidType

File

modules/csv_example/tests/src/Unit/Plugin/migrate/process/CommercePriceTest.php, line 64

Class

CommercePriceTest
Tests the Commerce Price plugin.

Namespace

Drupal\Tests\commerce_migrate_csv_example\Unit\Plugin\migrate\process

Code

public function testInvalidType($value = NULL) {
  $configuration = [];
  $this->plugin = new CommercePrice($configuration, 'map', []);
  $type = gettype($value);
  $this
    ->expectExceptionMessage(sprintf("Input should be an array, instead it was of type '%s'", $type));
  $this->plugin
    ->transform($value, $this->migrateExecutable, $this->row, 'foo');
}