You are here

protected function CaptchaBaseWebTestCase::getCaptchaTokenFromForm in CAPTCHA 6.2

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

Get the CAPTCHA token from the current form in the browser.

3 calls to CaptchaBaseWebTestCase::getCaptchaTokenFromForm()
CaptchaSessionReuseAttackTestCase::testCaptchaSessionReuseAttackDetectionOnCommentPreview in ./captcha.test
CaptchaSessionReuseAttackTestCase::testCaptchaSessionReuseAttackDetectionOnLoginForm in ./captcha.test
CaptchaSessionReuseAttackTestCase::testCaptchaSessionReuseAttackDetectionOnNodeForm in ./captcha.test

File

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

Class

CaptchaBaseWebTestCase
Base class for CAPTCHA tests.

Code

protected function getCaptchaTokenFromForm() {
  $elements = $this
    ->xpath('//input[@name="captcha_token"]');
  $captcha_token = (int) $elements[0]['value'];
  return $captcha_token;
}