You are here

function BotchaNoResubmitTestCase::assertFormSubmission in BOTCHA Spam Prevention 6.2

Same name and namespace in other branches
  1. 6.3 tests/botcha.simpletest.test \BotchaNoResubmitTestCase::assertFormSubmission()
  2. 7.2 botcha.test \BotchaNoResubmitTestCase::assertFormSubmission()
  3. 7.3 tests/botcha.simpletest.test \BotchaNoResubmitTestCase::assertFormSubmission()

Check whether our suspections are real.

Overrides BotchaBaseWebTestCase::assertFormSubmission

File

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

Class

BotchaNoResubmitTestCase

Code

function assertFormSubmission($form, $edit, $should_pass = TRUE, $button = NULL) {
  switch ($form) {
    case 'user_login':
    case 'comment':

      // Assertion itself.
      switch ($should_pass) {
        case FALSE:

          // Check for error message.
          $this
            ->assertText(BOTCHA_SESSION_REUSE_ATTACK_ERROR_MESSAGE, 'Submission should be blocked.', 'BOTCHA');
          break;
      }
      break;
  }

  // We are placing it to the end since we have a redirection there which
  // makes impossible to assert submission by these conditions.
  parent::assertFormSubmission($form, $edit, $should_pass, $button);
}