You are here

public function HtmlFilterTest::testTitleConfiguration in Search API 8

Tests preprocessing field values with "title" settings.

@dataProvider titleConfigurationDataProvider

Parameters

string $passed_value: The value that should be passed into process().

string $expected_value: The expected processed value.

bool $title_config: The value to set for the processor's "title" setting.

File

tests/src/Unit/Processor/HtmlFilterTest.php, line 47

Class

HtmlFilterTest
Tests the "HTML filter" processor.

Namespace

Drupal\Tests\search_api\Unit\Processor

Code

public function testTitleConfiguration($passed_value, $expected_value, $title_config) {
  $configuration = [
    'tags' => [],
    'title' => $title_config,
    'alt' => FALSE,
  ];
  $this->processor
    ->setConfiguration($configuration);
  $type = 'text';
  $this
    ->invokeMethod('processFieldValue', [
    &$passed_value,
    $type,
  ]);
  $this
    ->assertEquals($expected_value, $passed_value);
}