You are here

public function SubstrTest::testSubstrFail in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/migrate/tests/src/Unit/process/SubstrTest.php \Drupal\Tests\migrate\Unit\process\SubstrTest::testSubstrFail()

Tests invalid input type.

File

core/modules/migrate/tests/src/Unit/process/SubstrTest.php, line 62

Class

SubstrTest
Tests the substr plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testSubstrFail() {
  $configuration = [];
  $this->plugin = new Substr($configuration, 'map', []);
  $this
    ->expectException(MigrateException::class);
  $this
    ->expectExceptionMessage('The input value must be a string.');
  $this->plugin
    ->transform([
    'Captain Janeway',
  ], $this->migrateExecutable, $this->row, 'destination_property');
}