public function HoneypotFormTestCase::testProtectNodeFormTooFast in Honeypot 7
Test node form protection.
File
- ./
honeypot.test, line 147 - Testing for Honeypot module.
Class
- HoneypotFormTestCase
- Test the functionality of the Honeypot module for forms.
Code
public function testProtectNodeFormTooFast() {
// Log in the admin user.
$this
->drupalLogin($this->webUser);
// Reset the time limit to 5 seconds.
variable_set('honeypot_time_limit', 5);
// Set up the form and submit it.
$edit["title"] = 'Test Page';
$this
->drupalPost('node/add/article', $edit, t('Save'));
$this
->assertText(t('There was a problem with your form submission.'), 'Honeypot node form timestamp protection works.');
}