protected function CaptchaWebTestBase::assertCaptchaResponseAccepted in CAPTCHA 8
Assert that the response is accepted.
No "unknown CSID" message, no "CSID reuse attack detection" message, No "wrong answer" message.
9 calls to CaptchaWebTestBase::assertCaptchaResponseAccepted()
- CaptchaPersistenceTest::testPersistenceAlways in tests/
src/ Functional/ CaptchaPersistenceTest.php - Test persistence always.
- CaptchaPersistenceTest::testPersistenceOnlyOnce in tests/
src/ Functional/ CaptchaPersistenceTest.php - Test Persistence "Only once".
- CaptchaPersistenceTest::testPersistencePerFormInstance in tests/
src/ Functional/ CaptchaPersistenceTest.php - Test persistence per form instance.
- CaptchaPersistenceTest::testPersistencePerFormType in tests/
src/ Functional/ CaptchaPersistenceTest.php - Test Persistence per form type.
- CaptchaSessionReuseAttackTestCase::testCaptchaSessionReuseAttackDetectionOnCommentPreview in tests/
src/ Functional/ CaptchaSessionReuseAttackTestCase.php - Test captcha attack detection on comment form.
File
- tests/
src/ Functional/ CaptchaWebTestBase.php, line 121
Class
- CaptchaWebTestBase
- Base class for CAPTCHA tests.
Namespace
Drupal\Tests\captcha\FunctionalCode
protected function assertCaptchaResponseAccepted() {
// There should be no error message about unknown CAPTCHA session ID.
$this
->assertSession()
->pageTextNotContains(self::CAPTCHA_UNKNOWN_CSID_ERROR_MESSAGE, 'CAPTCHA response should be accepted (known CSID).', 'CAPTCHA');
// There should be no error message about wrong response.
$this
->assertSession()
->pageTextNotContains(self::CAPTCHA_WRONG_RESPONSE_ERROR_MESSAGE, 'CAPTCHA response should be accepted (correct response).', 'CAPTCHA');
}