protected function BotchaTimegateTestCase::setFormValues in BOTCHA Spam Prevention 7.3
Same name and namespace in other branches
- 6.2 botcha.test \BotchaTimegateTestCase::setFormValues()
- 6.3 tests/botcha.simpletest.test \BotchaTimegateTestCase::setFormValues()
- 7.2 botcha.test \BotchaTimegateTestCase::setFormValues()
Recipe should modify default form to break itself.
Parameters
type $form:
type $should_pass:
Return value
type
Overrides BotchaBaseWebTestCase::setFormValues
File
- tests/
botcha.simpletest.test, line 1357 - Simpletest-tests for BOTCHA module.
Class
Code
protected function setFormValues($form, $should_pass, &$parameters = array()) {
$edit = parent::setFormValues($form, $should_pass, $parameters);
switch ($should_pass) {
case FALSE:
unset($edit['timegate']);
break;
case TRUE:
default:
$edit['timegate'] = (int) time() - (int) variable_get('botcha_timegate', 5) - 1;
break;
}
return $edit;
}