You are here

protected function FlagJsTestBase::setUp in Flag 8.4

Overrides BrowserTestBase::setUp

File

tests/src/FunctionalJavascript/FlagJsTestBase.php, line 48

Class

FlagJsTestBase
Provides common methods for Flag tests.

Namespace

Drupal\Tests\flag\FunctionalJavascript

Code

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

  // Get the Flag Service.
  $this->flagService = \Drupal::service('flag');

  // Place the title block, otherwise some tests fail.
  $this
    ->drupalPlaceBlock('page_title_block', [
    'region' => 'content',
  ]);

  // Create content type.
  $this
    ->drupalCreateContentType([
    'type' => $this->nodeType,
  ]);

  // Create the admin user.
  $this->adminUser = $this
    ->createUser([
    'administer flags',
    'administer flagging display',
    'administer flagging fields',
    'administer node display',
    'administer modules',
    'administer nodes',
    'create ' . $this->nodeType . ' content',
    'edit any ' . $this->nodeType . ' content',
    'delete any ' . $this->nodeType . ' content',
  ]);
}