You are here

protected function MergeTermsTestBase::setUp in Term Merge 8

Overrides KernelTestBase::setUp

2 calls to MergeTermsTestBase::setUp()
MergeTermsConfirmTest::setUp in tests/src/Kernel/Form/MergeTermsConfirmTest.php
TermMergerNodeCrudTest::setUp in tests/src/Kernel/TermMergerNodeCrudTest.php
2 methods override MergeTermsTestBase::setUp()
MergeTermsConfirmTest::setUp in tests/src/Kernel/Form/MergeTermsConfirmTest.php
TermMergerNodeCrudTest::setUp in tests/src/Kernel/TermMergerNodeCrudTest.php

File

tests/src/Kernel/MergeTermsTestBase.php, line 86

Class

MergeTermsTestBase
Base class for Term merge kernel tests.

Namespace

Drupal\Tests\term_merge\Kernel

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installConfig([
    'filter',
  ]);
  $this
    ->installEntitySchema('taxonomy_term');
  $this
    ->installEntitySchema('taxonomy_vocabulary');
  $this
    ->installSchema('system', [
    'key_value_expire',
  ]);
  $dispatcher = $this
    ->prophesize(EventDispatcherInterface::class);
  $accountProxy = new AccountProxy($dispatcher
    ->reveal());
  $account = $this
    ->createMock(AccountInterface::class);
  $account
    ->method('id')
    ->willReturn(24);

  /** @var \Drupal\Core\Session\AccountInterface $account */
  $accountProxy
    ->setAccount($account);
  \Drupal::getContainer()
    ->set('current_user', $accountProxy);
  $this->privateTempStoreFactory = \Drupal::service('tempstore.private');
  $this->entityTypeManager = \Drupal::entityTypeManager();
  $this->vocabulary = $this
    ->createVocabulary();
  $this
    ->createTerms($this
    ->numberOfTermsToSetUp());
}