You are here

public function CommercePriceTest::testInvalidValue 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::testInvalidValue()
  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::testInvalidValue()

Tests that exception is thrown when input is not valid.

@dataProvider providerTestInvalidValue

File

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

Class

CommercePriceTest
Tests the Commerce Price plugin.

Namespace

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

Code

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