You are here

public function FindReplaceTest::testSingleValueCaseSensitive in Tamper 8

Test the plugin as case sensitve.

File

tests/src/Unit/Plugin/Tamper/FindReplaceTest.php, line 50

Class

FindReplaceTest
Tests the find and replace plugin.

Namespace

Drupal\Tests\tamper\Unit\Plugin\Tamper

Code

public function testSingleValueCaseSensitive() {
  $config = [
    FindReplace::SETTING_FIND => 'cat',
    FindReplace::SETTING_REPLACE => 'dog',
    FindReplace::SETTING_CASE_SENSITIVE => TRUE,
    FindReplace::SETTING_WORD_BOUNDARIES => FALSE,
    FindReplace::SETTING_WHOLE => FALSE,
  ];
  $plugin = new FindReplace($config, 'find_replace', [], $this
    ->getMockSourceDefinition());
  $this
    ->assertEquals('The dog went to the park.', $plugin
    ->tamper('The cat went to the park.'));
  $this
    ->assertEquals('The Cat went to the park.', $plugin
    ->tamper('The Cat went to the park.'));
  $this
    ->assertEquals('The dogwent to the park.', $plugin
    ->tamper('The catwent to the park.'));
}