protected function PasswordPolicyAdministratorPasswordChangeTestCase::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 PasswordPolicyAdministratorPasswordChangeTestCase::createAdmin()
- PasswordPolicyAdministratorPasswordChangeTestCase::setUp in tests/
password_policy.test - Set up the test.
File
- tests/
password_policy.test, line 818 - Functional tests for Password policy module.
Class
- PasswordPolicyAdministratorPasswordChangeTestCase
- Tests administrator changing password of another user.
Code
protected function createAdmin() {
global $user;
$pass = user_password();
$edit = array(
'pass' => $pass,
);
user_save($user, $edit);
$user->pass_raw = $pass;
$this->admin = $user;
}