You are here

protected function ImageCaptchaWebTestCase::getImageCaptchaForm in CAPTCHA 7

Helper function to get a CAPTCHA form.

2 calls to ImageCaptchaWebTestCase::getImageCaptchaForm()
ImageCaptchaWebTestCase::testNonEmptyImageCleanURLs in image_captcha/image_captcha.test
Tests if the image URL actually returns an image with clean URLs enabled.
ImageCaptchaWebTestCase::testNonEmptyImageDirtyURLs in image_captcha/image_captcha.test
Tests if the image URL actually returns an image with clean URLs disabled.

File

image_captcha/image_captcha.test, line 33
Tests for the Image CAPTCHA module.

Class

ImageCaptchaWebTestCase
@file Tests for the Image CAPTCHA module.

Code

protected function getImageCaptchaForm($form_id = 'user_login', $page = 'user') {

  // Set a CAPTCHA on supplied form.
  captcha_set_form_id_setting($form_id, 'image_captcha/Image');

  // Fetch the page and make sure that we got a CAPTCHA.
  $this
    ->drupalGet($page);
  $this
    ->assertCaptchaPresence(TRUE);
}