You are here

public function StrReplaceTest::testStrIreplace in Migrate Plus 8.4

Same name and namespace in other branches
  1. 8.5 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 32

Class

StrReplaceTest
Tests the str replace process plugin.

Namespace

Drupal\Tests\migrate_plus\Unit\process

Code

public function testStrIreplace() {
  $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);
}