You are here

protected function RedirectTest::drupalLogout in Login Destination 8.2

Same name and namespace in other branches
  1. 8 tests/src/Functional/RedirectTest.php \Drupal\Tests\login_destination\Functional\RedirectTest::drupalLogout()

Overrides UiHelperTrait::drupalLogout() to skip certain checks.

These checks confirm a logout by checking if you get on the login page. This won't happen if there is a redirect to a different page is supposed to happen after logging out.

Overrides UiHelperTrait::drupalLogout

2 calls to RedirectTest::drupalLogout()
RedirectTest::testNoRedirectAfterLogout in tests/src/Functional/RedirectTest.php
Tests no redirect after logging out without compatible destination rule.
RedirectTest::testRedirectAfterLogout in tests/src/Functional/RedirectTest.php
Tests redirecting after logging out.

File

tests/src/Functional/RedirectTest.php, line 70

Class

RedirectTest
Tests redirects.

Namespace

Drupal\Tests\login_destination\Functional

Code

protected function drupalLogout() {

  // Make a request to the logout page.
  $assert_session = $this
    ->assertSession();
  $this
    ->drupalGet('user/logout');

  // @see BrowserTestBase::drupalUserIsLoggedIn()
  unset($this->loggedInUser->sessionId);
  $this->loggedInUser = FALSE;
  \Drupal::currentUser()
    ->setAccount(new AnonymousUserSession());
}