public function DomainRegistrationTest::testAllowEmptyPatternMatch in Restrict Domain Registration 8
Tests allowing empty pattern match.
File
- src/
Tests/ DomainRegistrationTest.php, line 36
Class
- DomainRegistrationTest
- Test if the Domain Registration module allows and denies specified domains.
Namespace
Drupal\domain_registration\TestsCode
public function testAllowEmptyPatternMatch() {
\Drupal::configFactory()
->getEditable('domain_registration.settings')
->set('method', DOMAIN_REGISTRATION_ALLOW)
->save();
\Drupal::configFactory()
->getEditable('domain_registration.settings')
->set('pattern', '')
->save();
// Get the user data for registration.
$edit = [
'name' => $this
->randomMachineName(),
'mail' => $this
->randomMachineName() . '@example.com',
];
// Attempt to register a user with a whitelist email.
$this
->drupalPostForm('user/register', $edit, t('Create new account'));
$this
->assertText(t('A welcome message'), t('Thank you for applying for an account'));
}