protected function switchToWorkspace(WorkspaceInterface
$workspace) { $this->
assertTrue($this->switcherBlockConfigured, 'This test was not written correctly: you must call setupWorkspaceSwitcherBlock() before switchToWorkspace()'
);
/** @var \Drupal\Tests\WebAssert $session */
$session =
$this->
assertSession();
$session->
buttonExists('Activate'
);
$this->
submitForm(['workspace_id' =>
$workspace->
id()], 'Activate'
);
$session->
pageTextContains($workspace->
label() . ' is now the active workspace.'
);
// Keep the test runner in sync with the system under test.
\Drupal::
service('workspaces.manager'
)->
setActiveWorkspace($workspace);
} /**
* Switches to the live version of the site for subsequent requests.
*
* This assumes that the switcher block has already been setup by calling
* setupWorkspaceSwitcherBlock().
*/
protected function switchToLive() { /** @var \Drupal\Tests\WebAssert $session */
$session =
$this->
assertSession();