protected function BotchaTimegateTestCase::setFormValues in BOTCHA Spam Prevention 7.2
Same name and namespace in other branches
- 6.2 botcha.test \BotchaTimegateTestCase::setFormValues()
- 6.3 tests/botcha.simpletest.test \BotchaTimegateTestCase::setFormValues()
- 7.3 tests/botcha.simpletest.test \BotchaTimegateTestCase::setFormValues()
Recipe should modify default form to break itself.
Parameters
type $form:
type $should_pass:
Return value
type
Overrides BotchaBaseWebTestCase::setFormValues
File
- ./
botcha.test, line 1250 - Tests for BOTCHA module.
Class
Code
protected function setFormValues($form, $should_pass) {
$edit = parent::setFormValues($form, $should_pass);
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;
}