You are here

protected function PasswordPolicyPasswordLengthRestrictionTestCase::submitNotOverlongPassword in Password Policy 7

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

Submits a password that is not overlong.

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

File

tests/password_policy.test, line 1056
Functional tests for Password policy module.

Class

PasswordPolicyPasswordLengthRestrictionTestCase
Tests of restriction on password length.

Code

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