You are here

public function CommercePriceTest::testNotArray in Commerce Migrate 3.1.x

Same name and namespace in other branches
  1. 8.2 modules/commerce/tests/src/Unit/Plugin/migrate/process/commerce1/CommercePriceTest.php \Drupal\Tests\commerce_migrate_commerce\Unit\Plugin\migrate\process\commerce1\CommercePriceTest::testNotArray()
  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::testNotArray()

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

@dataProvider providerTestNotArray

File

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

Class

CommercePriceTest
Tests the Commerce Price plugin.

Namespace

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

Code

public function testNotArray($value = NULL) {
  $this
    ->expectException(MigrateSkipRowException::class);
  $this
    ->expectExceptionMessage("CommercePrice input is not an array for destination 'new_value'");
  $this->plugin = new CommercePrice([], 'test_format_date', []);
  $this->plugin
    ->transform($value, $this->migrateExecutable, $this->row, 'new_value');
}