You are here

public function HoneypotFormTestCase::testProtectCommentFormHoneypotFilled in Honeypot 7

File

./honeypot.test, line 122
Testing for Honeypot module.

Class

HoneypotFormTestCase
Test the functionality of the Honeypot module for forms.

Code

public function testProtectCommentFormHoneypotFilled() {
  $comment = 'Test comment.';

  // Log in the web user.
  $this
    ->drupalLogin($this->webUser);

  // Set up form and submit it.
  $edit['comment_body[' . LANGUAGE_NONE . '][0][value]'] = $comment;
  $edit['url'] = 'http://www.example.com/';
  $this
    ->drupalPost('comment/reply/' . $this->node->nid, $edit, t('Save'));
  $this
    ->assertText(t('There was a problem with your form submission. Please refresh the page and try again.'), 'Comment posted successfully.');
}