You are here

public function StrReplaceTest::testIsMultiple 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::testIsMultiple()

Test for multiple.

File

tests/src/Unit/process/StrReplaceTest.php, line 81

Class

StrReplaceTest
Tests the str replace process plugin.

Namespace

Drupal\Tests\migrate_plus\Unit\process

Code

public function testIsMultiple() {
  $value = [
    'vero eos et accusam et justo vero',
    'et eos vero accusam vero justo et',
  ];
  $expected = [
    'vero eos that accusam that justo vero',
    'that eos vero accusam vero justo that',
  ];
  $configuration['search'] = 'et';
  $configuration['replace'] = 'that';
  $plugin = new StrReplace($configuration, 'str_replace', []);
  $actual = $plugin
    ->transform($value, $this->migrateExecutable, $this->row, 'destinationproperty');
  $this
    ->assertArrayEquals($expected, $actual);
  $this
    ->assertTrue($plugin
    ->multiple());
}