You are here

protected function DrupalWebTestCase::drupalLogout in SimpleTest 7.2

Same name and namespace in other branches
  1. 6.2 drupal_web_test_case.php \DrupalWebTestCase::drupalLogout()
  2. 7 drupal_web_test_case.php \DrupalWebTestCase::drupalLogout()
2 calls to DrupalWebTestCase::drupalLogout()
DrupalWebTestCase::drupalLogin in ./drupal_web_test_case.php
Log in a user with the internal browser.
SimpleTestFunctionalTest::testInternalBrowser in ./simpletest.test
Test the internal browsers functionality.

File

./drupal_web_test_case.php, line 1211
Provides DrupalTestCase, DrupalUnitTestCase, and DrupalWebTestCase classes.

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;
  }
}