You are here

public function AutocompleteHelperTest::testSplitKeys in Search API Autocomplete 8

Tests splitting of user input into complete and incomplete words.

@covers ::splitKeys

@dataProvider providerTestSplitKeys

Parameters

string $keys: The processed keywords.

string[] $expected: The expected result of splitting the given user input.

File

tests/src/Unit/AutocompleteHelperTest.php, line 30

Class

AutocompleteHelperTest
Tests various utility methods of the Search API Autocomplete module.

Namespace

Drupal\Tests\search_api_autocomplete\Unit

Code

public function testSplitKeys($keys, array $expected) {
  $element_info = $this
    ->createMock(ElementInfoManagerInterface::class);
  $service = new AutocompleteHelper($element_info);
  $this
    ->assertEquals($expected, $service
    ->splitKeys($keys));
}