You are here

function UserLoginTestCase::testLoginWithAnonSession in Drupal 7

Test logging in when an anon session already exists.

File

modules/user/user.test, line 431
Tests for user.module.

Class

UserLoginTestCase
Functional tests for user logins, including rate limiting of login attempts.

Code

function testLoginWithAnonSession() {

  // Visit the callback to generate a session for this anon user.
  $this
    ->drupalGet('user_session_test_anon_session');

  // Now login.
  $account = $this
    ->drupalCreateUser(array());
  $this
    ->drupalLogin($account);
}