You are here

protected function TermMatcherTest::setUp in Linkit 8.5

Overrides LinkitKernelTestBase::setUp

File

tests/src/Kernel/Matchers/TermMatcherTest.php, line 35

Class

TermMatcherTest
Tests term matcher.

Namespace

Drupal\Tests\linkit\Kernel\Matchers

Code

protected function setUp() {
  parent::setUp();

  // Create user 1 who has special permissions.
  $this
    ->createUser();
  \Drupal::currentUser()
    ->setAccount($this
    ->createUser([], [
    'access content',
  ]));
  $this
    ->installEntitySchema('taxonomy_term');
  $this->manager = $this->container
    ->get('plugin.manager.linkit.matcher');
  $testing_vocabulary_1 = $this
    ->createVocabulary('testing_vocabulary_1');
  $testing_vocabulary_2 = $this
    ->createVocabulary('testing_vocabulary_2');
  $this
    ->createTerm($testing_vocabulary_1, [
    'name' => 'foo_bar',
  ]);
  $this
    ->createTerm($testing_vocabulary_1, [
    'name' => 'foo_baz',
  ]);
  $this
    ->createTerm($testing_vocabulary_1, [
    'name' => 'foo_foo',
  ]);
  $this
    ->createTerm($testing_vocabulary_1, [
    'name' => 'bar',
  ]);
  $this
    ->createTerm($testing_vocabulary_2, [
    'name' => 'foo_bar',
  ]);
  $this
    ->createTerm($testing_vocabulary_2, [
    'name' => 'foo_baz',
  ]);
}