protected function CaptchaBaseWebTestCase::assertCaptchaPresence in CAPTCHA 6.2
Same name and namespace in other branches
- 7 captcha.test \CaptchaBaseWebTestCase::assertCaptchaPresence()
Assert that there is a CAPTCHA on the form or not.
Parameters
bool $presence whether there should be a CAPTCHA or not.:
13 calls to CaptchaBaseWebTestCase::assertCaptchaPresence()
- CaptchaAdminTestCase::testUntrustedUserPosting in ./
captcha.test - CaptchaPersistenceTestCase::setUpPersistence in ./
captcha.test - Set up the persistence and CAPTCHA settings.
- CaptchaPersistenceTestCase::testPersistenceAlways in ./
captcha.test - CaptchaPersistenceTestCase::testPersistenceOnlyOnce in ./
captcha.test - CaptchaPersistenceTestCase::testPersistencePerFormInstance in ./
captcha.test
File
- ./
captcha.test, line 105 - Tests for CAPTCHA module.
Class
- CaptchaBaseWebTestCase
- Base class for CAPTCHA tests.
Code
protected function assertCaptchaPresence($presence) {
if ($presence) {
$this
->assertText(_captcha_get_description(), 'There should be a CAPTCHA on the form.', 'CAPTCHA');
}
else {
$this
->assertNoText(_captcha_get_description(), 'There should be no CAPTCHA on the form.', 'CAPTCHA');
}
}