protected function DrupalWebTestCase::drupalLogout

7.x drupal_web_test_case.php protected DrupalWebTestCase::drupalLogout()
85 calls to DrupalWebTestCase::drupalLogout()
AccessDeniedTestCase::testAccessDenied in drupal-7.x/modules/system/system.test
BlockCacheTestCase::testCacheGlobal in drupal-7.x/modules/block/block.test
Test DRUPAL_CACHE_GLOBAL.
BlockCacheTestCase::testCachePerRole in drupal-7.x/modules/block/block.test
Test DRUPAL_CACHE_PER_ROLE.
BlockTestCase::testBlockVisibility in drupal-7.x/modules/block/block.test
Test block visibility.
BlockTestCase::testBlockVisibilityListedEmpty in drupal-7.x/modules/block/block.test
Test block visibility when using "pages" restriction but leaving "pages" textarea empty

... See full list

File

drupal-7.x/modules/simpletest/drupal_web_test_case.php, line 1270

Class

DrupalWebTestCase
Test case for typical Drupal tests.

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');
  $this->drupalGet('user');
  $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;
  }
}