You are here

protected function BotchaBaseWebTestCase::assertBotchaPresence in BOTCHA Spam Prevention 7

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

Assert that there is a BOTCHA on the form or not.

Parameters

bool $presence whether there should be a BOTCHA or not.:

10 calls to BotchaBaseWebTestCase::assertBotchaPresence()
BotchaAdminTestCase::testUntrustedUserPosting in ./botcha.test
BotchaSessionReuseAttackTestCase::testBotchaSessionReuseAttackDetectionOnCommentPreview in ./botcha.test
BotchaSessionReuseAttackTestCase::testBotchaSessionReuseAttackDetectionOnLoginForm in ./botcha.test
BotchaSessionReuseAttackTestCase::testBotchaSessionReuseAttackDetectionOnNodeForm in ./botcha.test
BotchaTestCase::assertCommentPosting in ./botcha.test
Assert function for testing if comment posting works as it should.

... See full list

File

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

Class

BotchaBaseWebTestCase
Base class for BOTCHA tests.

Code

protected function assertBotchaPresence($presence) {
  if ($presence) {
    $this
      ->assertText('If you\'re a human, don\'t change the following field', 'There should be a BOTCHA on the form.', 'BOTCHA');
  }
  else {
    $this
      ->assertNoText('If you\'re a human, don\'t change the following field', 'There should be no BOTCHA on the form.', 'BOTCHA');
  }
}