You are here

protected function BotchaBaseWebTestCase::getFormBuildIdFromForm in BOTCHA Spam Prevention 6

Same name and namespace in other branches
  1. 6.2 botcha.test \BotchaBaseWebTestCase::getFormBuildIdFromForm()
  2. 6.3 tests/botcha.simpletest.test \BotchaBaseWebTestCase::getFormBuildIdFromForm()
  3. 7 botcha.test \BotchaBaseWebTestCase::getFormBuildIdFromForm()
  4. 7.2 botcha.test \BotchaBaseWebTestCase::getFormBuildIdFromForm()
  5. 7.3 tests/botcha.simpletest.test \BotchaBaseWebTestCase::getFormBuildIdFromForm()

Get the form_build_id from the current form in the browser.

3 calls to BotchaBaseWebTestCase::getFormBuildIdFromForm()
BotchaSessionReuseAttackTestCase::testBotchaSessionReuseAttackDetectionOnCommentPreview in ./botcha.test
BotchaSessionReuseAttackTestCase::testBotchaSessionReuseAttackDetectionOnLoginForm in ./botcha.test
BotchaSessionReuseAttackTestCase::testBotchaSessionReuseAttackDetectionOnNodeForm in ./botcha.test

File

./botcha.test, line 193
Tests for BOTCHA module.

Class

BotchaBaseWebTestCase
Base class for BOTCHA tests.

Code

protected function getFormBuildIdFromForm() {
  $elements = $this
    ->xpath('//input[@name="form_build_id"]');
  $form_build_id = isset($elements[0]['value']) ? $elements[0]['value'] : FALSE;
  debug('$form_build_id value=' . $form_build_id . '<br>elements=<pre>' . print_r($elements, 1) . '</pre>');
  return $form_build_id;
}