You are here

protected function WorkspaceTestUtilities::switchToLive in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/workspaces/tests/src/Functional/WorkspaceTestUtilities.php \Drupal\Tests\workspaces\Functional\WorkspaceTestUtilities::switchToLive()
  2. 10 core/modules/workspaces/tests/src/Functional/WorkspaceTestUtilities.php \Drupal\Tests\workspaces\Functional\WorkspaceTestUtilities::switchToLive()

Switches to the live version of the site for subsequent requests.

This assumes that the switcher block has already been setup by calling setupWorkspaceSwitcherBlock().

4 calls to WorkspaceTestUtilities::switchToLive()
PathWorkspacesTest::testPathAliases in core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php
Tests path aliases with workspaces.
PathWorkspacesTest::testPathAliasesWithTranslation in core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php
Tests path aliases with workspaces for translatable nodes.
WorkspaceConcurrentEditingTest::testConcurrentEditing in core/modules/workspaces/tests/src/Functional/WorkspaceConcurrentEditingTest.php
Test editing a node in multiple workspaces.
WorkspaceContentModerationIntegrationTest::testModerationInWorkspace in core/modules/content_moderation/tests/src/Functional/WorkspaceContentModerationIntegrationTest.php
Tests moderating nodes in a workspace.

File

core/modules/workspaces/tests/src/Functional/WorkspaceTestUtilities.php, line 113

Class

WorkspaceTestUtilities
Utility methods for use in BrowserTestBase tests.

Namespace

Drupal\Tests\workspaces\Functional

Code

protected function switchToLive() {

  /** @var \Drupal\Tests\WebAssert $session */
  $session = $this
    ->assertSession();
  $this
    ->drupalPostForm(NULL, [], 'Switch to Live');
  $session
    ->pageTextContains('You are now viewing the live version of the site.');
}