You are here

function PasswordStrengthTestCase::setRequiredScore in Password Strength 7

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

Sets a required score through the admin UI.

Parameters

int $score: An integer corresponding to a password strength.

1 call to PasswordStrengthTestCase::setRequiredScore()
PasswordStrengthTestCase::testChangePassword in tests/password_strength.test
Tests various levels of minimum scores when changing a user account password.

File

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

Class

PasswordStrengthTestCase
@file Tests for password strength module.

Code

function setRequiredScore($score) {
  $this
    ->drupalLogin($this->admin_user);
  $edit = array();
  $edit['password_strength_default_required_score'] = $score;
  $this
    ->drupalPost('admin/config/system/password-strength', $edit, t('Save configuration'));

  // Ensure the value was saved.
  $this
    ->assertIdentical(variable_get('password_strength_default_required_score'), $score, 'Password strength was saved properly.');
}