public function SubstrTest::testLengthIsString in Drupal 10
Same name and namespace in other branches
- 8 core/modules/migrate/tests/src/Unit/process/SubstrTest.php \Drupal\Tests\migrate\Unit\process\SubstrTest::testLengthIsString()
- 9 core/modules/migrate/tests/src/Unit/process/SubstrTest.php \Drupal\Tests\migrate\Unit\process\SubstrTest::testLengthIsString()
Tests that the length parameter is an integer.
File
- core/
modules/ migrate/ tests/ src/ Unit/ process/ SubstrTest.php, line 84
Class
- SubstrTest
- Tests the substr plugin.
Namespace
Drupal\Tests\migrate\Unit\processCode
public function testLengthIsString() {
$configuration['length'] = '1';
$this->plugin = new Substr($configuration, 'map', []);
$this
->expectException(MigrateException::class);
$this
->expectExceptionMessage('The character length configuration value should be an integer. Omit this key to capture from the start position to the end of the string.');
$this->plugin
->transform([
'foo',
], $this->migrateExecutable, $this->row, 'destination_property');
}