public function HoneypotFormTest::testProtectRegisterUserNormal in Honeypot 8
Same name and namespace in other branches
- 2.0.x tests/src/Functional/HoneypotFormTest.php \Drupal\Tests\honeypot\Functional\HoneypotFormTest::testProtectRegisterUserNormal()
Test user registration (anonymous users).
File
- tests/
src/ Functional/ HoneypotFormTest.php, line 125
Class
- HoneypotFormTest
- Test Honeypot spam protection functionality.
Namespace
Drupal\Tests\honeypot\FunctionalCode
public function testProtectRegisterUserNormal() {
// Set up form and submit it.
$edit['name'] = $this
->randomMachineName();
$edit['mail'] = $edit['name'] . '@example.com';
$this
->drupalPostForm('user/register', $edit, $this
->t('Create new account'));
// Form should have been submitted successfully.
$this
->assertSession()
->pageTextContains('A welcome message with further instructions has been sent to your email address.');
}