You are here

public function HighlightTest::testFieldRenaming in Search API 8

Tests whether the processor handles field ID changes correctly.

File

tests/src/Unit/Processor/HighlightTest.php, line 69

Class

HighlightTest
Tests the "Highlight" processor.

Namespace

Drupal\Tests\search_api\Unit\Processor

Code

public function testFieldRenaming() {
  $configuration['exclude_fields'] = [
    'body',
    'title',
  ];
  $this->processor
    ->setConfiguration($configuration);
  $this->index
    ->method('getFieldRenames')
    ->willReturn([
    'title' => 'foobar',
  ]);
  $this->processor
    ->preIndexSave();
  $fields = $this->processor
    ->getConfiguration()['exclude_fields'];
  sort($fields);
  $this
    ->assertEquals([
    'body',
    'foobar',
  ], $fields);
}