You are here

public function TokenizerTest::preprocessSearchQueryProvider in Search API 8

Provides test data for testPreprocessSearchQuery().

Return value

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

  • The original keys.
  • The expected keys after preprocessing.

File

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

Class

TokenizerTest
Tests the "Tokenizer" processor.

Namespace

Drupal\Tests\search_api\Unit\Processor

Code

public function preprocessSearchQueryProvider() {
  $cases = [
    'convert whitespace' => [
      "foo\tbar\n\nbaz ",
      'foo bar baz',
    ],
    'single dash' => [
      'foo-bar',
      'foobar',
    ],
    'multiple dashes' => [
      'foo--bar',
      'foo bar',
    ],
    'remove short word' => [
      'foo in bar',
      'foo bar',
    ],
    'single short word' => [
      'in',
      '',
    ],
  ];
  return $cases;
}