You are here

public function SimpleLdapUserTestCase::drupalNoLogin in Simple LDAP 7.2

Same name and namespace in other branches
  1. 7 simple_ldap_user/simple_ldap_user.test \SimpleLdapUserTestCase::drupalNoLogin()

Verify that a user is unable to log in.

3 calls to SimpleLdapUserTestCase::drupalNoLogin()
SimpleLdapUserAuthenticationWebTestCase::testBadAuthentication in simple_ldap_user/simple_ldap_user.test
Tests invalid login credentials.
SimpleLdapUserAuthenticationWebTestCase::testGoodAuthentication in simple_ldap_user/simple_ldap_user.test
Test user authentication.
SimpleLdapUserPasswordResetTestCase::testPasswordChange in simple_ldap_user/simple_ldap_user.test
Tests that a user can change thier password.

File

simple_ldap_user/simple_ldap_user.test, line 219
Tests for Simple LDAP User module.

Class

SimpleLdapUserTestCase
@file Tests for Simple LDAP User module.

Code

public function drupalNoLogin(stdClass $user) {
  if ($this->loggedInUser) {
    $this
      ->drupalLogout();
  }
  $edit = array(
    'name' => $user->name,
    'pass' => $user->pass_raw,
  );
  $this
    ->drupalPost('user', $edit, t('Log in'));

  // Verify that the user was unable to log in.
  $pass = $this
    ->assertNoLink(t('Log out'), 0, t('User %name unable to log in.', array(
    '%name' => $user->name,
  )), t('User login'));
  if (!$pass) {
    $this->loggedInUser = $user;
  }
}