You are here

protected function FlagActionTest::setUp in Flag 8.4

Same name in this branch
  1. 8.4 tests/src/Kernel/FlagActionTest.php \Drupal\Tests\flag\Kernel\FlagActionTest::setUp()
  2. 8.4 tests/src/Unit/Plugin/Action/FlagActionTest.php \Drupal\Tests\flag\Unit\Plugin\Action\FlagActionTest::setUp()

Overrides FlagKernelTestBase::setUp

File

tests/src/Kernel/FlagActionTest.php, line 45

Class

FlagActionTest
Test flag actions are added/removed when flags are added/deleted.

Namespace

Drupal\Tests\flag\Kernel

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installEntitySchema('entity_test');
  $this->entityTypeManager = $this->container
    ->get('entity_type.manager');

  // Fake a logged in user (non-admin).
  $this->admin = $this
    ->createUser();
  $this->account = $this
    ->createUser();

  /** @var \Drupal\Core\Session\AccountSwitcherInterface $switcher */
  $switcher = $this->container
    ->get('account_switcher');
  $switcher
    ->switchTo($this->account);
}