You are here

protected function WorkspaceTestUtilities::switchToLive in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/workspaces/tests/src/Functional/WorkspaceTestUtilities.php \Drupal\Tests\workspaces\Functional\WorkspaceTestUtilities::switchToLive()
  2. 9 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().

File

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

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
    ->submitForm([], 'Switch to Live');
  $session
    ->pageTextContains('You are now viewing the live version of the site.');
}