You are here

protected function BotchaBaseWebTestCase::assertBotchaResponseAccepted in BOTCHA Spam Prevention 7.2

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

Assert that the response is accepted: no "unknown CSID" message, no "CSID reuse attack detection" message, no "wrong answer" message.

1 call to BotchaBaseWebTestCase::assertBotchaResponseAccepted()
BotchaBaseWebTestCase::assertCommentFormSubmission in ./botcha.test
Assert function for testing if comment posting works as it should.

File

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

Class

BotchaBaseWebTestCase
Base class for BOTCHA tests.

Code

protected function assertBotchaResponseAccepted() {

  // There should be no error message about unknown BOTCHA session ID.
  $this
    ->assertNoText(t(BOTCHA_UNKNOWN_CSID_ERROR_MESSAGE), 'BOTCHA response should be accepted (known CSID).', 'BOTCHA');

  // There should be no error message about CSID reuse attack.
  $this
    ->assertNoText(t(BOTCHA_SESSION_REUSE_ATTACK_ERROR_MESSAGE), 'BOTCHA response should be accepted (no BOTCHA session reuse attack detection).', 'BOTCHA');

  // There should be no error message about wrong response.

  //$this->assertNoText(t(BOTCHA_NO_JS_ERROR_MESSAGE),

  //  'BOTCHA response should be accepted (JS enabled).',
  //  'BOTCHA');
}