protected function WebTestBase::drupalLogout

88 calls to WebTestBase::drupalLogout()
AccessDeniedTest::testAccessDenied in drupal/core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php
BareMinimalUpgradePathTest::testBasicMinimalUpgrade in drupal/core/modules/system/lib/Drupal/system/Tests/Upgrade/BareMinimalUpgradePathTest.php
Tests a successful major version release upgrade.
BareStandardUpgradePathTest::testBasicStandardUpgrade in drupal/core/modules/system/lib/Drupal/system/Tests/Upgrade/BareStandardUpgradePathTest.php
Tests a successful major version release upgrade.
BlockCacheTest::testCacheGlobal in drupal/core/modules/block/lib/Drupal/block/Tests/BlockCacheTest.php
Test DRUPAL_CACHE_GLOBAL.
BlockCacheTest::testCachePerRole in drupal/core/modules/block/lib/Drupal/block/Tests/BlockCacheTest.php
Test DRUPAL_CACHE_PER_ROLE.

... See full list

File

drupal/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php, line 600
Definition of Drupal\simpletest\WebTestBase.

Class

WebTestBase
Test case for typical Drupal tests.

Namespace

Drupal\simpletest

Code

protected function drupalLogout() {

  // Make a request to the logout page, and redirect to the user page, the
  // idea being if you were properly logged out you should be seeing a login
  // screen.
  $this
    ->drupalGet('user/logout', array(
    'query' => array(
      'destination' => 'user',
    ),
  ));
  $this
    ->assertResponse(200, t('User was logged out.'));
  $pass = $this
    ->assertField('name', t('Username field found.'), t('Logout'));
  $pass = $pass && $this
    ->assertField('pass', t('Password field found.'), t('Logout'));
  if ($pass) {
    $this->loggedInUser = FALSE;
  }
}