function WorkspacesFileItemTest::setUp

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

Overrides FileItemTest::setUp

File

core/modules/workspaces/tests/src/Kernel/WorkspacesFileItemTest.php, line 39

Class

WorkspacesFileItemTest
Tests using entity fields of the file field type in a workspace.

Namespace

Drupal\Tests\workspaces\Kernel

Code

protected function setUp() : void {
    parent::setUp();
    $this->entityTypeManager = \Drupal::entityTypeManager();
    $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.