function WorkspaceViewsBulkFormTest::setUp

Same name in other branches
  1. 11.x core/modules/workspaces/tests/src/Functional/WorkspaceViewsBulkFormTest.php \Drupal\Tests\workspaces\Functional\WorkspaceViewsBulkFormTest::setUp()

Overrides BulkFormTest::setUp

File

core/modules/workspaces/tests/src/Functional/WorkspaceViewsBulkFormTest.php, line 28

Class

WorkspaceViewsBulkFormTest
Tests the views bulk form in a workspace.

Namespace

Drupal\Tests\workspaces\Functional

Code

protected function setUp() : void {
    parent::setUp();
    // Override the user created in the parent method to add workspaces access.
    $admin_user = $this->drupalCreateUser([
        'administer nodes',
        'administer workspaces',
        'edit any page content',
        'delete any page content',
    ]);
    $this->drupalLogin($admin_user);
    // Ensure that all the test methods are executed in the context of a
    // workspace.
    $this->setupWorkspaceSwitcherBlock();
    $stage = Workspace::load('stage');
    $this->switchToWorkspace($stage);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.