You are here

public function LdapTestCase::AttemptLogonNewUser in Lightweight Directory Access Protocol (LDAP) 7.2

Same name and namespace in other branches
  1. 8.2 ldap_test/LdapTestCase.class.php \LdapTestCase::AttemptLogonNewUser()
1 call to LdapTestCase::AttemptLogonNewUser()
LdapAuthenticationTestCase::testAuthenticationWhitelistTests in ldap_authentication/tests/ldap_authentication.test

File

ldap_test/LdapTestCase.class.php, line 187

Class

LdapTestCase

Code

public function AttemptLogonNewUser($name, $goodpwd = TRUE) {
  $this
    ->drupalLogout();
  $edit = [
    'name' => $name,
    'pass' => $goodpwd ? "goodpwd" : "badpwd",
  ];
  $user = user_load_by_name($name);
  if ($user) {
    user_delete($user->uid);
  }
  $this
    ->drupalPost('user', $edit, t('Log in'));
}