You are here

protected function ForwardTestBase::setUp in Forward 8.3

Same name and namespace in other branches
  1. 8 src/Tests/ForwardTestBase.php \Drupal\forward\Tests\ForwardTestBase::setUp()
  2. 8.2 src/Tests/ForwardTestBase.php \Drupal\forward\Tests\ForwardTestBase::setUp()

Perform any initial set up tasks that run before every test method

Overrides WebTestBase::setUp

File

src/Tests/ForwardTestBase.php, line 43

Class

ForwardTestBase
Provides a base class for testing the Forward module.

Namespace

Drupal\forward\Tests

Code

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

  // Create Basic page and Article node types.
  if ($this->profile != 'standard') {
    $this
      ->drupalCreateContentType([
      'type' => 'page',
      'name' => 'Basic page',
      'display_submitted' => FALSE,
    ]);
    $this
      ->drupalCreateContentType([
      'type' => 'article',
      'name' => 'Article',
    ]);
  }

  // Create test users.
  $this->webUser = $this
    ->drupalCreateUser([
    'access content',
  ]);
  $this->forwardUser = $this
    ->drupalCreateUser([
    'access content',
    'access forward',
  ]);
  $permissions = [
    'access forward',
    'administer forward',
    'administer users',
    'bypass node access',
  ];
  $this->adminUser = $this
    ->drupalCreateUser($permissions);
}