You are here

public function IgnoreCharacterTest::testIgnorableCharacters in Search API 8

Tests preprocessing with the "Ignorable characters" setting.

@dataProvider ignorableCharactersDataProvider

Parameters

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

string $expected_value: The expected processed value.

string $ignorable: The "ignorable" setting to set on the processor.

File

tests/src/Unit/Processor/IgnoreCharacterTest.php, line 122

Class

IgnoreCharacterTest
Tests the "Ignore characters" processor.

Namespace

Drupal\Tests\search_api\Unit\Processor

Code

public function testIgnorableCharacters($passed_value, $expected_value, $ignorable) {
  $this->processor
    ->setConfiguration([
    'ignorable' => $ignorable,
    'ignorable_classes' => [],
  ]);
  $this
    ->invokeMethod('process', [
    &$passed_value,
    'text',
  ]);
  $this
    ->assertSame($expected_value, $passed_value);
}