You are here

public function DedupeEntityTest::testDedupeEntityInvalidStart in Drupal 8

Tests that invalid start position throws an exception.

File

core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php, line 87

Class

DedupeEntityTest
@coversDefaultClass \Drupal\migrate\Plugin\migrate\process\DedupeEntity @group migrate @group legacy

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testDedupeEntityInvalidStart() {
  $configuration = [
    'entity_type' => 'test_entity_type',
    'field' => 'test_field',
    'start' => 'foobar',
  ];
  $plugin = new DedupeEntity($configuration, 'dedupe_entity', [], $this
    ->getMigration(), $this->entityTypeManager);
  $this
    ->expectException('Drupal\\migrate\\MigrateException');
  $this
    ->expectExceptionMessage('The start position configuration key should be an integer. Omit this key to capture from the beginning of the string.');
  $plugin
    ->transform('test_start', $this->migrateExecutable, $this->row, 'testproperty');
}