You are here

public function TokenizerTest::searchSimplifyPunctuationProvider in Search API 8

Provides test data for testSearchSimplifyPunctuation().

Return value

array Arrays of parameters for testSearchSimplifyPunctuation(), each containing (in this order):

  • The string passed to simplifyText().
  • The expected return value.
  • The message to display for the assertion.

File

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

Class

TokenizerTest
Tests the "Tokenizer" processor.

Namespace

Drupal\Tests\search_api\Unit\Processor

Code

public function searchSimplifyPunctuationProvider() {
  $cases = [
    [
      '20.03/94-28,876',
      '20039428876',
      'Punctuation removed from numbers',
    ],
    [
      'great...drupal--module',
      'great drupal module',
      'Multiple dot and dashes are word boundaries',
    ],
    [
      'very_great-drupal.module',
      'verygreatdrupalmodule',
      'Single dot, dash, underscore are removed',
    ],
    [
      'regular,punctuation;word',
      'regular punctuation word',
      'Punctuation is a word boundary',
    ],
    [
      'Äußerung français repülőtér',
      'Äußerung français repülőtér',
      'Umlauts and accented characters are not treated as word boundaries',
    ],
  ];
  return $cases;
}