You are here

protected function ModerationDashboardTestBase::setUp in Moderation Dashboard 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Functional/ModerationDashboardTestBase.php \Drupal\Tests\moderation_dashboard\Functional\ModerationDashboardTestBase::setUp()

Overrides BrowserTestBase::setUp

3 calls to ModerationDashboardTestBase::setUp()
ModerationDashboardComponentsTest::setUp in tests/src/Functional/ModerationDashboardComponentsTest.php
ModerationDashboardPersonalizedComponentsTest::setUp in tests/src/Functional/ModerationDashboardPersonalizedComponentsTest.php
ModerationDashboardRedirectTest::setUp in tests/src/Functional/ModerationDashboardRedirectTest.php
3 methods override ModerationDashboardTestBase::setUp()
ModerationDashboardComponentsTest::setUp in tests/src/Functional/ModerationDashboardComponentsTest.php
ModerationDashboardPersonalizedComponentsTest::setUp in tests/src/Functional/ModerationDashboardPersonalizedComponentsTest.php
ModerationDashboardRedirectTest::setUp in tests/src/Functional/ModerationDashboardRedirectTest.php

File

tests/src/Functional/ModerationDashboardTestBase.php, line 69

Class

ModerationDashboardTestBase
Defines a base class for testing Moderation Dashboard module.

Namespace

Drupal\Tests\moderation_dashboard\Functional

Code

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

  // Create content types for tests.
  foreach ($this->testNodeTypes as $node_type_properties) {
    $this
      ->drupalCreateContentType($node_type_properties);
  }

  // Create editorial workflow.
  $this->editorialWorkflow = $this
    ->createEditorialWorkflow();
  if ($this->setEditorialWorkflow) {
    foreach ($this->testNodeTypes as $node_type_properties) {
      $this->editorialWorkflow
        ->getTypePlugin()
        ->addEntityTypeAndBundle('node', $node_type_properties['type']);
    }
    $this->editorialWorkflow
      ->save();
  }

  // Create test user.
  $this->user = $this
    ->createUser($this->userPermissions, 'test user');
}