public function StrReplaceTest::testStrReplace in Migrate Plus 8.5
Same name and namespace in other branches
- 8.4 tests/src/Unit/process/StrReplaceTest.php \Drupal\Tests\migrate_plus\Unit\process\StrReplaceTest::testStrReplace()
Test for a simple str_replace string.
File
- tests/
src/ Unit/ process/ StrReplaceTest.php, line 20
Class
- StrReplaceTest
- Tests the str replace process plugin.
Namespace
Drupal\Tests\migrate_plus\Unit\processCode
public function testStrReplace() : void {
$value = 'vero eos et accusam et justo vero';
$configuration['search'] = 'et';
$configuration['replace'] = 'that';
$plugin = new StrReplace($configuration, 'str_replace', []);
$actual = $plugin
->transform($value, $this->migrateExecutable, $this->row, 'destinationproperty');
$this
->assertSame('vero eos that accusam that justo vero', $actual);
}