You are here

public function CommerceAdjustmentsTest::testNotSet in Commerce Migrate 3.1.x

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/Plugin/migrate/process/CommerceAdjustmentsTest.php \Drupal\Tests\commerce_migrate\Kernel\Plugin\migrate\process\CommerceAdjustmentsTest::testNotSet()
  2. 3.0.x tests/src/Kernel/Plugin/migrate/process/CommerceAdjustmentsTest.php \Drupal\Tests\commerce_migrate\Kernel\Plugin\migrate\process\CommerceAdjustmentsTest::testNotSet()

Tests required values not set.

@dataProvider providerNotSet

File

tests/src/Kernel/Plugin/migrate/process/CommerceAdjustmentsTest.php, line 258

Class

CommerceAdjustmentsTest
Tests the CommerceAdjustment plugin.

Namespace

Drupal\Tests\commerce_migrate\Kernel\Plugin\migrate\process

Code

public function testNotSet($value = NULL, $property = NULL) {
  if (is_string($property)) {
    $msg = sprintf("Property '%s' is not set for adjustment '%s'", $property, var_export($value, TRUE));
  }
  else {
    $msg = sprintf("Properties 'amount' and 'currency_code' are not set for adjustment '%s'", var_export($value, TRUE));
  }
  $this
    ->expectException(MigrateSkipRowException::class);
  $this
    ->expectExceptionMessage($msg);
  $this->plugin
    ->transform([
    $value,
  ], $this->migrateExecutable, $this->row, 'destination_property');
}