You are here

public function BotchaTimegateTestCase::assertFormSubmission in BOTCHA Spam Prevention 7.3

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

Check whether our suspections are real.

Overrides BotchaBaseWebTestCase::assertFormSubmission

File

tests/botcha.simpletest.test, line 1382
Simpletest-tests for BOTCHA module.

Class

BotchaTimegateTestCase

Code

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

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

          // Check for error message.
          $this
            ->assertText(BOTCHA_TIMEGATE_TIMEOUT_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, $parameters);
}