You are here

public function TransliterationTest::testTransliterationWithString in Search API 8

Tests that strings are affected.

File

tests/src/Unit/Processor/TransliterationTest.php, line 76

Class

TransliterationTest
Tests the "Transliteration" processor.

Namespace

Drupal\Tests\search_api\Unit\Processor

Code

public function testTransliterationWithString() {
  $field_value = 'test_string';

  /** @var \Drupal\search_api\Item\FieldInterface $field */
  $items = $this
    ->createSingleFieldItem($this->index, 'string', $field_value, $field);
  $this->processor
    ->preprocessIndexItems($items);
  $expected_value = "translit-{$field_value}-en?";
  $this
    ->assertEquals([
    $expected_value,
  ], $field
    ->getValues(), 'Strings are correctly transliterated.');
}