You are here

protected function CaptchaBaseWebTestCase::assertCaptchaPresence in CAPTCHA 7

Same name and namespace in other branches
  1. 6.2 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.:

14 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

... See full list

File

./captcha.test, line 113
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');
  }
}