function WorkspaceInformationTest::setUp

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

Overrides KernelTestBase::setUp

File

core/modules/workspaces/tests/src/Kernel/WorkspaceInformationTest.php, line 60

Class

WorkspaceInformationTest
Tests the workspace information service.

Namespace

Drupal\Tests\workspaces\Kernel

Code

protected function setUp() : void {
    parent::setUp();
    $this->entityTypeManager = \Drupal::entityTypeManager();
    $this->workspaceInformation = \Drupal::service('workspaces.information');
    $this->state = \Drupal::state();
    $this->installEntitySchema('entity_test');
    $this->installEntitySchema('entity_test_rev');
    $this->installEntitySchema('entity_test_revpub');
    $this->installEntitySchema('workspace');
    $this->installSchema('workspaces', [
        'workspace_association',
    ]);
    // Create a new workspace and activate it.
    Workspace::create([
        'id' => 'stage',
        'label' => 'Stage',
    ])->save();
    $this->switchToWorkspace('stage');
}

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