You are here

public function AttributeDestinationTest::testInvalidValue in Commerce Migrate 3.0.x

Same name and namespace in other branches
  1. 8.2 modules/csv_example/tests/src/Unit/Plugin/migrate/process/AttributeDestinationTest.php \Drupal\Tests\commerce_migrate_csv_example\Unit\Plugin\migrate\process\AttributeDestinationTest::testInvalidValue()
  2. 3.1.x modules/csv_example/tests/src/Unit/Plugin/migrate/process/AttributeDestinationTest.php \Drupal\Tests\commerce_migrate_csv_example\Unit\Plugin\migrate\process\AttributeDestinationTest::testInvalidValue()

Tests that exception is thrown when input is not valid.

@dataProvider providerTestInvalidValue

File

modules/csv_example/tests/src/Unit/Plugin/migrate/process/AttributeDestinationTest.php, line 60

Class

AttributeDestinationTest
Tests the Attribute Destination process plugin.

Namespace

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

Code

public function testInvalidValue($value = NULL) {
  $this
    ->expectException(MigrateException::class);
  $this
    ->expectExceptionMessage("There must be an even number of input values.");
  $this->plugin = new AttributeDestination([], 'test_format_date', []);
  $this->plugin
    ->transform($value, $this->migrateExecutable, $this->row, 'foo');
}