function SubstrTest::testSubstrFail
Same name in other branches
- 9 core/modules/migrate/tests/src/Unit/process/SubstrTest.php \Drupal\Tests\migrate\Unit\process\SubstrTest::testSubstrFail()
- 8.9.x core/modules/migrate/tests/src/Unit/process/SubstrTest.php \Drupal\Tests\migrate\Unit\process\SubstrTest::testSubstrFail()
- 11.x 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 64
Class
- SubstrTest
- Tests the substr plugin.
Namespace
Drupal\Tests\migrate\Unit\processCode
public function testSubstrFail() : void {
$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');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.