You are here

protected function BotchaBaseWebTestCase::assertBotchaPresence in BOTCHA Spam Prevention 7.2

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 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.:

2 calls to BotchaBaseWebTestCase::assertBotchaPresence()
BotchaBaseWebTestCase::assertCommentFormSubmission in ./botcha.test
Assert function for testing if comment posting works as it should.
BotchaBaseWebTestCase::getForm in ./botcha.test
Get one of predefined forms. Used to unify the process of testing.
3 methods override BotchaBaseWebTestCase::assertBotchaPresence()
BotchaNoResubmitTestCase::assertBotchaPresence in ./botcha.test
Assert that there is a BOTCHA on the form or not.
BotchaTimegateTestCase::assertBotchaPresence in ./botcha.test
Assert that there is a BOTCHA on the form or not.
BotchaUsingJsTestCase::assertBotchaPresence in ./botcha.test
Assert that there is a BOTCHA on the form or not.

File

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