You are here

function UserMatcherTest::testUserMatcherWidthRoleFiler in Linkit 8.4

Tests user matcher with role filer.

File

src/Tests/Matchers/UserMatcherTest.php, line 77
Contains \Drupal\linkit\Tests\Matchers\UserMatcherTest.

Class

UserMatcherTest
Tests user matcher.

Namespace

Drupal\linkit\Tests\Matchers

Code

function testUserMatcherWidthRoleFiler() {

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