You are here

public function HtmlFilterTest::testAltConfiguration in Search API 8

Tests preprocessing field values with "alt" settings.

@dataProvider altConfigurationDataProvider

Parameters

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

mixed $expected_value: The expected processed value.

bool $alt_config: The value to set for the processor's "alt" setting.

File

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

Class

HtmlFilterTest
Tests the "HTML filter" processor.

Namespace

Drupal\Tests\search_api\Unit\Processor

Code

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