You are here

public function HoneypotFormTest::testProtectNodeFormPreviewPassthru in Honeypot 8

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

Test node form protection.

File

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

Class

HoneypotFormTest
Test Honeypot spam protection functionality.

Namespace

Drupal\Tests\honeypot\Functional

Code

public function testProtectNodeFormPreviewPassthru() {

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

  // Post a node form using the 'Preview' button and make sure it's allowed.
  $edit["title[0][value]"] = 'Test Page';
  $this
    ->drupalPostForm('node/add/article', $edit, $this
    ->t('Preview'));
  $this
    ->assertSession()
    ->pageTextNotContains('There was a problem with your form submission.');
}