You are here

protected function PasswordPolicyPasswordLengthRestrictionTestCase::submitOverlongPassword in Password Policy 7

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

Submits a password that is overlong.

1 call to PasswordPolicyPasswordLengthRestrictionTestCase::submitOverlongPassword()
PasswordPolicyPasswordLengthRestrictionTestCase::testOverlongPasswordSubmission in tests/password_policy.test
Tests module response to submission of an overlong password.

File

tests/password_policy.test, line 1041
Functional 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/1/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.');
}