You are here

function PasswordStrengthTestCase::testChangePassword in Password Strength 7

Same name and namespace in other branches
  1. 6.2 tests/password_strength.test \PasswordStrengthTestCase::testChangePassword()

Tests various levels of minimum scores when changing a user account password.

File

tests/password_strength.test, line 41
Tests for password strength module.

Class

PasswordStrengthTestCase
@file Tests for 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');
}