public function BotchaNoResubmitTestCase::assertFormSubmission in BOTCHA Spam Prevention 7.3
Same name and namespace in other branches
- 6.2 botcha.test \BotchaNoResubmitTestCase::assertFormSubmission()
- 6.3 tests/botcha.simpletest.test \BotchaNoResubmitTestCase::assertFormSubmission()
- 7.2 botcha.test \BotchaNoResubmitTestCase::assertFormSubmission()
Check whether our suspections are real.
Overrides BotchaBaseWebTestCase::assertFormSubmission
File
- tests/
botcha.simpletest.test, line 1289 - Simpletest-tests for BOTCHA module.
Class
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_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, $parameters);
}