You are here

public function DomStrReplaceTest::providerTestTransform in Migrate Plus 8.4

Same name and namespace in other branches
  1. 8.5 tests/src/Unit/process/DomStrReplaceTest.php \Drupal\Tests\migrate_plus\Unit\process\DomStrReplaceTest::providerTestTransform()

Dataprovider for testTransform().

File

tests/src/Unit/process/DomStrReplaceTest.php, line 116

Class

DomStrReplaceTest
Tests the dom_str_replace process plugin.

Namespace

Drupal\Tests\migrate_plus\Unit\process

Code

public function providerTestTransform() {
  $cases = [
    'string:case_sensitive' => [
      '<a href="/foo/Foo/foo">text</a>',
      $this->exampleConfiguration,
      '<a href="/bar/Foo/bar">text</a>',
    ],
    'string:case_insensitive' => [
      '<a href="/foo/Foo/foo">text</a>',
      [
        'case_insensitive' => TRUE,
      ] + $this->exampleConfiguration,
      '<a href="/bar/bar/bar">text</a>',
    ],
    'regex' => [
      '<a href="/foo/Foo/foo">text</a>',
      [
        'search' => '/(.)\\1/',
        'regex' => TRUE,
      ] + $this->exampleConfiguration,
      '<a href="/fbar/Fbar/fbar">text</a>',
    ],
  ];
  return $cases;
}