You are here

public function HoneypotTriggerTestCase::testHoneypotTriggerIntegration in Honeypot 7

Test trigger integration.

File

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

Class

HoneypotTriggerTestCase
Test the functionality of the Honeypot module's integration with Trigger.

Code

public function testHoneypotTriggerIntegration() {

  // 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'));

  // Make sure Honeypot is working.
  $this
    ->assertText(t('There was a problem with your form submission.'), 'Honeypot working correctly.');

  // Visit the home page and make sure the user is banned.
  $this
    ->drupalGet('node');
  $this
    ->assertText(t('has been banned'), 'User banned successfully.');
}