You are here

public function FindReplaceRegexTest::testSingleValueCaseSensitive in Tamper 8

Test the plugin as case sensitive.

File

tests/src/Unit/Plugin/Tamper/FindReplaceRegexTest.php, line 38

Class

FindReplaceRegexTest
Tests the find and replace regex plugin.

Namespace

Drupal\Tests\tamper\Unit\Plugin\Tamper

Code

public function testSingleValueCaseSensitive() {
  $config = [
    FindReplaceRegex::SETTING_FIND => '/cat/i',
    FindReplaceRegex::SETTING_REPLACE => 'dog',
    FindReplaceRegex::SETTING_LIMIT => '',
  ];
  $plugin = new FindReplaceRegex($config, 'find_replace_regex', [], $this
    ->getMockSourceDefinition());
  $this
    ->assertEquals('The dog went to the park.', $plugin
    ->tamper('The Cat went to the park.'));
}