You are here

public function TokenizerTest::testSearchSimplifyPunctuation in Search API 8

Tests whether punctuation is treated correctly.

@dataProvider searchSimplifyPunctuationProvider

Parameters

string $passed_value: The string passed to simplifyText().

string $expected_value: The expected return value.

string $message: The message to display for the assertion.

File

tests/src/Unit/Processor/TokenizerTest.php, line 364

Class

TokenizerTest
Tests the "Tokenizer" processor.

Namespace

Drupal\Tests\search_api\Unit\Processor

Code

public function testSearchSimplifyPunctuation($passed_value, $expected_value, $message) {

  // Set the minimum word size to 1 (to split all CJK characters).
  $this->processor
    ->setConfiguration([
    'minimum_word_size' => 1,
  ]);
  $this
    ->invokeMethod('prepare');
  $out = $this
    ->invokeMethod('simplifyText', [
    $passed_value,
  ]);
  $this
    ->assertEquals($expected_value, $out, $message);
}