You are here

public function HoneypotFormTest::testProtectCommentFormHoneypotBypass in Honeypot 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Functional/HoneypotFormTest.php \Drupal\Tests\honeypot\Functional\HoneypotFormTest::testProtectCommentFormHoneypotBypass()

Test for comment form honeypot bypass.

File

tests/src/Functional/HoneypotFormTest.php, line 228

Class

HoneypotFormTest
Test Honeypot spam protection functionality.

Namespace

Drupal\Tests\honeypot\Functional

Code

public function testProtectCommentFormHoneypotBypass() {

  // Log in the admin user.
  $this
    ->drupalLogin($this->adminUser);

  // Get the comment reply form and ensure there's no 'url' field.
  $this
    ->drupalGet('comment/reply/node/' . $this->node
    ->id() . '/comment');
  $this
    ->assertSession()
    ->responseNotContains('id="edit-url" name="url"');
}