You are here

protected function CaptchaSessionReuseAttackTestCase::assertCaptchaSessionIdReuseAttackDetection in CAPTCHA 8

Assert that the CAPTCHA session ID reuse attack was detected.

3 calls to CaptchaSessionReuseAttackTestCase::assertCaptchaSessionIdReuseAttackDetection()
CaptchaSessionReuseAttackTestCase::testCaptchaSessionReuseAttackDetectionOnCommentPreview in tests/src/Functional/CaptchaSessionReuseAttackTestCase.php
Test captcha attack detection on comment form.
CaptchaSessionReuseAttackTestCase::testCaptchaSessionReuseAttackDetectionOnLoginForm in tests/src/Functional/CaptchaSessionReuseAttackTestCase.php
Test Captcha attack detection on login form.
CaptchaSessionReuseAttackTestCase::testCaptchaSessionReuseAttackDetectionOnNodeForm in tests/src/Functional/CaptchaSessionReuseAttackTestCase.php
Test captcha attach detection on node form.

File

tests/src/Functional/CaptchaSessionReuseAttackTestCase.php, line 15

Class

CaptchaSessionReuseAttackTestCase
Tests CAPTCHA session reusing.

Namespace

Drupal\Tests\captcha\Functional

Code

protected function assertCaptchaSessionIdReuseAttackDetection() {

  // There should be an error message about wrong response.
  $this
    ->assertSession()
    ->pageTextContains(self::CAPTCHA_WRONG_RESPONSE_ERROR_MESSAGE, 'CAPTCHA response should flagged as wrong.', 'CAPTCHA');
}