You are here

protected function CaptchaBaseWebTestCase::getCaptchaTokenFromForm in CAPTCHA 7

Same name and namespace in other branches
  1. 6.2 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 173
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;
}