public function CommercePriceTest::testInvalidType in Commerce Migrate 3.0.x
Same name in this branch
- 3.0.x modules/magento/tests/src/Unit/Plugin/migrate/process/CommercePriceTest.php \Drupal\Tests\commerce_migrate_magento\Unit\Plugin\migrate\process\CommercePriceTest::testInvalidType()
- 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()
- 3.0.x 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
- 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.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()
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\processCode
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');
}