You are here

protected function PasswordPolicyExpirationTestCase::createAdmin in Password Policy 7

Creates a usable admin (UID=1) user.

SimpleTest creates an admin user, but it cannot log in since it has no password set. So, we give it a password.

1 call to PasswordPolicyExpirationTestCase::createAdmin()
PasswordPolicyExpirationTestCase::setUp in tests/password_policy_expiration.test
Sets up the test.

File

tests/password_policy_expiration.test, line 41
Tests for Password policy module expiration functionality.

Class

PasswordPolicyExpirationTestCase
Tests of password expiration.

Code

protected function createAdmin() {
  global $user;
  $pass = user_password();
  $edit = array(
    'pass' => $pass,
  );
  user_save($user, $edit);
  $user->pass_raw = $pass;
  $this->admin = $user;
}