You are here

public function UserMatcherTest::testUserMatcherWidthRoleFiler in Linkit 8.5

Tests user matcher with role filer.

File

tests/src/Kernel/Matchers/UserMatcherTest.php, line 80

Class

UserMatcherTest
Tests user matcher.

Namespace

Drupal\Tests\linkit\Kernel\Matchers

Code

public function testUserMatcherWidthRoleFiler() {

  /** @var \Drupal\linkit\MatcherInterface $plugin */
  $plugin = $this->manager
    ->createInstance('entity:user', [
    'settings' => [
      'roles' => [
        'custom_role' => 'custom_role',
      ],
    ],
  ]);
  $suggestions = $plugin
    ->execute('Lorem');
  $this
    ->assertEquals(2, count($suggestions
    ->getSuggestions()), 'Correct number of suggestions');
}