You are here

public function UserRestrictionsLoginTest::testUserRestrictionsCheckWildcardNotMatch in User restrictions 8

Tests wildcards for name patterns that should not match.

File

tests/src/Functional/UserRestrictionsLoginTest.php, line 73

Class

UserRestrictionsLoginTest
Tests login restrictions.

Namespace

Drupal\Tests\user_restrictions\Functional

Code

public function testUserRestrictionsCheckWildcardNotMatch() {
  $this
    ->drupalGet('user/register');
  $mail = $this
    ->randomMachineName() . '@' . $this
    ->randomMachineName() . '.com';
  $edit = [];
  $edit['name'] = 'ilikecoffee';
  $edit['mail'] = $mail;
  $this
    ->drupalPostForm('user/register', $edit, t('Create new account'));
  $this
    ->assertText(t('A welcome message with further instructions has been sent to your email address.'), 'User registered successfully.');
}