public function HoneypotFormTestCase::testProtectUserRegisterHoneypotFilled in Honeypot 7
File
- ./
honeypot.test, line 80 - Testing for Honeypot module.
Class
- HoneypotFormTestCase
- Test the functionality of the Honeypot module for forms.
Code
public function testProtectUserRegisterHoneypotFilled() {
// Set up form and submit it.
$edit['name'] = $this
->randomName();
$edit['mail'] = $edit['name'] . '@example.com';
$edit['url'] = 'http://www.example.com/';
$this
->drupalPost('user/register', $edit, t('Create new account'));
// Form should have error message.
$this
->assertText(t('There was a problem with your form submission. Please refresh the page and try again.'), 'Registration form protected by honeypot.');
}