function PasswordStrengthTestCase::testChangePassword in Password Strength 6.2
Same name and namespace in other branches
- 7 tests/password_strength.test \PasswordStrengthTestCase::testChangePassword()
Tests various levels of minimum scores when changing a user account password.
File
- tests/
password_strength.test, line 43 - Tests for password strength module.
Class
- PasswordStrengthTestCase
- Tests the functionality of the Password Strength module.
Code
function testChangePassword() {
// Set required score to very weak and test that any password works.
$this
->setRequiredScore('0');
$this
->changePassword($this->web_user, 'Password1');
$this
->changePassword($this->web_user, '35qzYI^HUbAZ');
// Set required score to very strong and test that a weak password fails and
// that a strong password works.
$this
->setRequiredScore('4');
$this
->changePassword($this->web_user, 'Password1', TRUE);
$this
->changePassword($this->web_user, '35qzYI^HUbAZ');
}