You are here

protected function CaptchaBaseWebTestCase::getCaptchaSidFromForm in CAPTCHA 7

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

Get the CAPTCHA session id from the current form in the browser.

9 calls to CaptchaBaseWebTestCase::getCaptchaSidFromForm()
CaptchaPersistenceTestCase::assertDifferentCsid in ./captcha.test
CaptchaPersistenceTestCase::assertPreservedCsid in ./captcha.test
CaptchaPersistenceTestCase::testPersistenceAlways in ./captcha.test
CaptchaPersistenceTestCase::testPersistenceOnlyOnce in ./captcha.test
CaptchaPersistenceTestCase::testPersistencePerFormInstance in ./captcha.test

... See full list

File

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

Class

CaptchaBaseWebTestCase
Base class for CAPTCHA tests.

Code

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