You are here

public function LinkitAutocompleteTest::testAutocompletionFront in Linkit 8.5

Tests that 'front' adds the front page match.

File

tests/src/Kernel/LinkitAutocompleteTest.php, line 92

Class

LinkitAutocompleteTest
Tests the linkit autocomplete functionality.

Namespace

Drupal\Tests\linkit\Kernel

Code

public function testAutocompletionFront() {

  /** @var \Drupal\linkit\MatcherInterface $plugin */
  $plugin = $this->matcherManager
    ->createInstance('front_page');
  $this->linkitProfile
    ->addMatcher($plugin
    ->getConfiguration());
  $this->linkitProfile
    ->save();
  $data = $this
    ->getAutocompleteResult('front');
  $this
    ->assertSame('Front page', $data[0]['label'], 'Autocomplete returned the front page suggestion.');
}