function WorkspaceEntityDeleteTest::setUp

Same name in this branch
  1. 11.x core/modules/workspaces/tests/src/Functional/WorkspaceEntityDeleteTest.php \Drupal\Tests\workspaces\Functional\WorkspaceEntityDeleteTest::setUp()
Same name in other branches
  1. 10 core/modules/workspaces/tests/src/Kernel/WorkspaceEntityDeleteTest.php \Drupal\Tests\workspaces\Kernel\WorkspaceEntityDeleteTest::setUp()
  2. 10 core/modules/workspaces/tests/src/Functional/WorkspaceEntityDeleteTest.php \Drupal\Tests\workspaces\Functional\WorkspaceEntityDeleteTest::setUp()

Overrides KernelTestBase::setUp

File

core/modules/workspaces/tests/src/Kernel/WorkspaceEntityDeleteTest.php, line 48

Class

WorkspaceEntityDeleteTest
Tests entity deletions with workspaces.

Namespace

Drupal\Tests\workspaces\Kernel

Code

protected function setUp() : void {
    parent::setUp();
    $this->entityTypeManager = \Drupal::entityTypeManager();
    $this->workspaceManager = \Drupal::service('workspaces.manager');
    $this->installEntitySchema('node');
    $this->installEntitySchema('workspace');
    $this->installSchema('node', [
        'node_access',
    ]);
    $this->installSchema('workspaces', [
        'workspace_association',
    ]);
    $this->installConfig([
        'filter',
        'node',
        'system',
    ]);
    $this->createContentType([
        'type' => 'page',
    ]);
    $this->setUpCurrentUser([], [
        'access content',
        'create page content',
        'edit any page content',
        'delete any page content',
        'create workspace',
        'view any workspace',
        'edit any workspace',
        'delete any workspace',
    ]);
}

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