You are here

protected function DrupalWebTestCase::drupalLogout in SimpleTest 7

Same name and namespace in other branches
  1. 6.2 drupal_web_test_case.php \DrupalWebTestCase::drupalLogout()
  2. 7.2 drupal_web_test_case.php \DrupalWebTestCase::drupalLogout()
4 calls to DrupalWebTestCase::drupalLogout()
DrupalWebTestCase::drupalLogin in ./drupal_web_test_case.php
Log in a user with the internal browser.
MenuIncTestCase::testThemeCallbackOptionalTheme in tests/menu.test
Test the theme callback when it is set to use an optional theme.
SessionTestCase::testDataPersistence in tests/session.test
Test data persistence via the session_test module callbacks. Also tests drupal_session_count() since session data is already generated here.
SessionTestCase::testSessionSaveRegenerate in tests/session.test
Tests for drupal_save_session() and drupal_session_regenerate().

File

./drupal_web_test_case.php, line 1004

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', array(
    'query' => array(
      'destination' => '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;
  }
}