You are here

protected function AjaxLinkTest::setUp in Flag 8.4

Overrides BrowserTestBase::setUp

File

tests/src/FunctionalJavascript/AjaxLinkTest.php, line 77

Class

AjaxLinkTest
Javascript test for AjaxLinks.

Namespace

Drupal\Tests\flag\FunctionalJavascript

Code

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

  // A article to test with.
  $this
    ->createContentType([
    'type' => 'article',
  ]);
  $this->admin = $this
    ->createUser();
  $this->node = $this
    ->createNode([
    'type' => 'article',
    'uid' => $this->admin
      ->id(),
  ]);

  // A test flag.
  $this->flag = $this
    ->createFlag('node', [
    'article',
  ], 'ajax_link');
  $this->flagService = $this->container
    ->get('flag');
  $this->webUser = $this
    ->createUser([
    'access content',
  ]);
  $this
    ->grantFlagPermissions($this->flag);
  $this
    ->drupalLogin($this->webUser);
}