public function ExplodeTest::testExplodeWithNonStrictAndNonCastable in Drupal 8
Same name and namespace in other branches
- 9 core/modules/migrate/tests/src/Unit/process/ExplodeTest.php \Drupal\Tests\migrate\Unit\process\ExplodeTest::testExplodeWithNonStrictAndNonCastable()
- 10 core/modules/migrate/tests/src/Unit/process/ExplodeTest.php \Drupal\Tests\migrate\Unit\process\ExplodeTest::testExplodeWithNonStrictAndNonCastable()
Tests that explode raises an exception when the value cannot be casted to string.
File
- core/
modules/ migrate/ tests/ src/ Unit/ process/ ExplodeTest.php, line 95
Class
- ExplodeTest
- Tests the Explode process plugin.
Namespace
Drupal\Tests\migrate\Unit\processCode
public function testExplodeWithNonStrictAndNonCastable() {
$plugin = new Explode([
'delimiter' => '|',
'strict' => FALSE,
], 'map', []);
$this
->expectException(MigrateException::class);
$this
->expectExceptionMessage('cannot be casted to a string');
$processed = $plugin
->transform([
'foo',
], $this->migrateExecutable, $this->row, 'destination_property');
$this
->assertSame([
'foo',
], $processed);
}