diff --git a/core/modules/simpletest/src/UserCreationTrait.php b/core/modules/simpletest/src/UserCreationTrait.php index 13212f9..b985d87 100644 --- a/core/modules/simpletest/src/UserCreationTrait.php +++ b/core/modules/simpletest/src/UserCreationTrait.php @@ -60,7 +60,8 @@ protected function createUser(array $permissions = array(), $name = NULL, $admin // Create a user assigned to that role. $edit = array(); - $edit['name'] = !empty($name) ? $name : $this->getRandomGenerator()->string(8, TRUE, array($this, 'randomUsernameValidate')); + $edit['name'] = !empty($name) ? $name : $this->getRandomGenerator()->string(6, TRUE, array($this, 'randomUsernameValidate')); + $edit['name'] .= "'s"; $edit['mail'] = $edit['name'] . '@example.com'; // It is possible that name + @example.com is not a valid email address // since user names can contain whitespace and @ characters and start with a diff --git a/core/modules/system/src/Tests/System/PageNotFoundTest.php b/core/modules/system/src/Tests/System/PageNotFoundTest.php index b7c0609..623fd31 100644 --- a/core/modules/system/src/Tests/System/PageNotFoundTest.php +++ b/core/modules/system/src/Tests/System/PageNotFoundTest.php @@ -48,6 +48,6 @@ function testPageNotFound() { $this->drupalPostForm('admin/config/system/site-information', $edit, t('Save configuration')); $this->drupalGet($this->randomMachineName(10)); - $this->assertText($this->adminUser->getUsername(), 'Found the custom 404 page'); + $this->assertEscaped($this->adminUser->getUsername(), 'Found the custom 404 page'); } }