You are here

protected function CaptchaBaseWebTestCase::assertCaptchaResponseAccepted in CAPTCHA 7

Same name and namespace in other branches
  1. 6.2 captcha.test \CaptchaBaseWebTestCase::assertCaptchaResponseAccepted()

Assert that the response is accepted: no "unknown CSID" message, no "CSID reuse attack detection" message, no "wrong answer" message.

9 calls to CaptchaBaseWebTestCase::assertCaptchaResponseAccepted()
CaptchaPersistenceTestCase::testPersistenceAlways in ./captcha.test
CaptchaPersistenceTestCase::testPersistenceOnlyOnce in ./captcha.test
CaptchaPersistenceTestCase::testPersistencePerFormInstance in ./captcha.test
CaptchaPersistenceTestCase::testPersistencePerFormType in ./captcha.test
CaptchaSessionReuseAttackTestCase::testCaptchaSessionReuseAttackDetectionOnCommentPreview in ./captcha.test

... See full list

File

./captcha.test, line 94
Tests for CAPTCHA module.

Class

CaptchaBaseWebTestCase
Base class for CAPTCHA tests.

Code

protected function assertCaptchaResponseAccepted() {

  // There should be no error message about unknown CAPTCHA session ID.
  $this
    ->assertNoText(t(CAPTCHA_UNKNOWN_CSID_ERROR_MESSAGE), 'CAPTCHA response should be accepted (known CSID).', 'CAPTCHA');

  // There should be no error message about CSID reuse attack.
  $this
    ->assertNoText(t(CAPTCHA_SESSION_REUSE_ATTACK_ERROR_MESSAGE), 'CAPTCHA response should be accepted (no CAPTCHA session reuse attack detection).', 'CAPTCHA');

  // There should be no error message about wrong response.
  $this
    ->assertNoText(t(CAPTCHA_WRONG_RESPONSE_ERROR_MESSAGE), 'CAPTCHA response should be accepted (correct response).', 'CAPTCHA');
}