function WorkspacesMediaLibraryIntegrationTest::setUp

Overrides EntityReferenceWidgetTest::setUp

File

core/modules/workspaces/tests/src/FunctionalJavascript/WorkspacesMediaLibraryIntegrationTest.php, line 41

Class

WorkspacesMediaLibraryIntegrationTest
Tests the Media library entity reference widget in a workspace.

Namespace

Drupal\Tests\workspaces\FunctionalJavascript

Code

public function setUp() : void {
  if (in_array($this->name(), static::SKIP_METHODS, TRUE)) {
    $this->markTestSkipped('Irrelevant for this test');
  }
  parent::setUp();
  // Ensure that all the test methods are executed in the context of a
  // workspace.
  $workspace = Workspace::create([
    'id' => 'test',
    'label' => 'Test',
  ]);
  $workspace->save();
  \Drupal::service('workspaces.manager')->setActiveWorkspace($workspace);
}

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