public function UserRestrictionsLoginTest::testUserRestrictionsCheckWildcardMatch in User restrictions 8
Tests wildcards for name patterns that should match.
File
- tests/
src/ Functional/ UserRestrictionsLoginTest.php, line 87
Class
- UserRestrictionsLoginTest
- Tests login restrictions.
Namespace
Drupal\Tests\user_restrictions\FunctionalCode
public function testUserRestrictionsCheckWildcardMatch() {
$this
->drupalGet('user/register');
$name = 'coffeelover';
$edit = [];
$edit['name'] = $name;
$edit['mail'] = $this
->randomMachineName() . '@' . $this
->randomMachineName() . '.com';
$this
->drupalPostForm('user/register', $edit, t('Create new account'));
$text = (string) new FormattableMarkup('The name <em class="placeholder">@name</em> is reserved, and cannot be used.', [
'@name' => $name,
]);
$this
->assertRaw((string) $text, 'User "name" restricted.');
}