public function StrReplaceTest::testStrIreplace 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::testStrIreplace()
Test for case insensitive searches.
File
- tests/
src/ Unit/ process/ StrReplaceTest.php, line 33
Class
- StrReplaceTest
- Tests the str replace process plugin.
Namespace
Drupal\Tests\migrate_plus\Unit\processCode
public function testStrIreplace() : void {
$value = 'VERO eos et accusam et justo vero';
$configuration['search'] = 'vero';
$configuration['replace'] = 'that';
$configuration['case_insensitive'] = TRUE;
$plugin = new StrReplace($configuration, 'str_replace', []);
$actual = $plugin
->transform($value, $this->migrateExecutable, $this->row, 'destinationproperty');
$this
->assertSame('that eos et accusam et justo that', $actual);
}