You are here

public function UserRestrictionsLoginTest::testUserRestrictionsCheckNameWhitelist in User restrictions 8

Ensure whitelists override blacklists for name patterns.

File

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

Class

UserRestrictionsLoginTest
Tests login restrictions.

Namespace

Drupal\Tests\user_restrictions\Functional

Code

public function testUserRestrictionsCheckNameWhitelist() {
  $this
    ->drupalGet('user/register');
  $edit = [];
  $edit['name'] = 'lolcats';
  $edit['mail'] = $this
    ->randomMachineName() . '@example.com';
  $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.');
}