You are here

protected function PasswordPolicyPasswordLengthRestrictionTestCase::submitOverlongPassword in Password Policy 7.2

Same name and namespace in other branches
  1. 7 tests/password_policy.test \PasswordPolicyPasswordLengthRestrictionTestCase::submitOverlongPassword()

Submits a password that is overlong.

1 call to PasswordPolicyPasswordLengthRestrictionTestCase::submitOverlongPassword()
PasswordPolicyPasswordLengthRestrictionTestCase::testOverlongPasswordSubmission in ./password_policy.test
Sets a password policy that applies to the authenticated user role.

File

./password_policy.test, line 494
Unit tests for Password policy module.

Class

PasswordPolicyPasswordLengthRestrictionTestCase
Tests of restriction on password length.

Code

protected function submitOverlongPassword() {
  $pass = str_repeat('a', 513);
  $edit = array(
    'current_pass' => $this->admin->pass_raw,
    'pass[pass1]' => $pass,
    'pass[pass2]' => $pass,
  );
  $this
    ->drupalPost('user/' . $this->admin->uid . '/edit', $edit, t('Save'));
  $this
    ->assertText(t('Password exceeds maximum length.'), 'Overlong password causes form error.');
  $this
    ->assertNoText(t('The changes have been saved.'), 'Overlong password is not saved.');
}