protected function ImageCaptchaWebTestCase::assertNonEmptyImage in CAPTCHA 7
Asserts that the image URL actually returns an image.
2 calls to ImageCaptchaWebTestCase::assertNonEmptyImage()
- 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 45 - Tests for the Image CAPTCHA module.
Class
- ImageCaptchaWebTestCase
- @file Tests for the Image CAPTCHA module.
Code
protected function assertNonEmptyImage() {
$img = $this
->getCaptchaImageFromForm();
// Try to fetch the image.
$this
->drupalGet($this
->getAbsoluteUrl($img['src']));
$this
->assertTrue($this
->drupalGetHeader('Content-Length') > 0, 'Image CAPTCHA image is not empty.');
}