diff --git a/core/modules/comment/src/Tests/CommentTokenReplaceTest.php b/core/modules/comment/src/Tests/CommentTokenReplaceTest.php index b7172e3..a498e54 100644 --- a/core/modules/comment/src/Tests/CommentTokenReplaceTest.php +++ b/core/modules/comment/src/Tests/CommentTokenReplaceTest.php @@ -118,7 +118,7 @@ function testCommentTokenReplacement() { foreach ($tests as $input => $expected) { $bubbleable_metadata = new BubbleableMetadata(); $output = $token_service->replace($input, array('comment' => $comment), array('langcode' => $language_interface->getId()), $bubbleable_metadata); - $this->assertEqual($output, $expected, new FormattableMarkup('Comment token %token replaced.', ['%token' => $input])); + $this->assertEqual(html_entity_decode($output, ENT_QUOTES, 'UTF-8'), html_entity_decode($expected, ENT_QUOTES, 'UTF-8'), new FormattableMarkup('Comment token %token replaced.', ['%token' => $input])); $this->assertEqual($bubbleable_metadata, $metadata_tests[$input]); } diff --git a/core/modules/language/src/Tests/LanguageUrlRewritingTest.php b/core/modules/language/src/Tests/LanguageUrlRewritingTest.php index 748e338..f590861 100644 --- a/core/modules/language/src/Tests/LanguageUrlRewritingTest.php +++ b/core/modules/language/src/Tests/LanguageUrlRewritingTest.php @@ -66,7 +66,7 @@ function testUrlRewritingEdgeCases() { // Check that URL rewriting is not applied to subrequests. $this->drupalGet('language_test/subrequest'); - $this->assertEscaped($this->webUser->getUsername(), 'Page correctly retrieved'); + $this->assertText($this->webUser->getUsername(), 'Page correctly retrieved'); } /** diff --git a/core/modules/simpletest/src/UserCreationTrait.php b/core/modules/simpletest/src/UserCreationTrait.php index b985d87..4ffc5d6 100644 --- a/core/modules/simpletest/src/UserCreationTrait.php +++ b/core/modules/simpletest/src/UserCreationTrait.php @@ -61,7 +61,9 @@ 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(6, TRUE, array($this, 'randomUsernameValidate')); - $edit['name'] .= "'s"; + if (empty($name)) { + $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/Path/UrlAlterFunctionalTest.php b/core/modules/system/src/Tests/Path/UrlAlterFunctionalTest.php index e3a7dc5..9d29886 100644 --- a/core/modules/system/src/Tests/Path/UrlAlterFunctionalTest.php +++ b/core/modules/system/src/Tests/Path/UrlAlterFunctionalTest.php @@ -37,7 +37,7 @@ function testUrlAlter() { // Test a single altered path. $this->drupalGet("user/$name"); $this->assertResponse('200', 'The user/username path gets resolved correctly'); - $this->assertUrlOutboundAlter("user/$uid", "user/" . urlencode($name)); + $this->assertUrlOutboundAlter("/user/$uid", "/user/" . $name); // Test that a path always uses its alias. $path = array('source' => "/user/$uid/test1", 'alias' => '/alias/test1'); @@ -62,7 +62,7 @@ function testUrlAlter() { // level and for a specific existing forum. $this->drupalGet('community'); $this->assertText('General discussion', 'The community path gets resolved correctly'); - $this->assertUrlOutboundAlter('/forum', '/communitym'); + $this->assertUrlOutboundAlter('/forum', '/community'); $forum_vid = $this->config('forum.settings')->get('vocabulary'); $term_name = $this->randomMachineName(); $term = entity_create('taxonomy_term', array( @@ -72,7 +72,7 @@ function testUrlAlter() { $term->save(); $this->drupalGet("community/" . $term->id()); $this->assertText($term_name, 'The community/{tid} path gets resolved correctly'); - $this->assertUrlOutboundAlter("/forum/" . $term->id(), "/communitym/" . $term->id()); + $this->assertUrlOutboundAlter("/forum/" . $term->id(), "/community/" . $term->id()); } /** diff --git a/core/modules/system/src/Tests/System/AccessDeniedTest.php b/core/modules/system/src/Tests/System/AccessDeniedTest.php index 3874dd0..b068802 100644 --- a/core/modules/system/src/Tests/System/AccessDeniedTest.php +++ b/core/modules/system/src/Tests/System/AccessDeniedTest.php @@ -65,7 +65,7 @@ function testAccessDenied() { // Log out and check that the user login block is shown on custom 403 pages. $this->drupalLogout(); $this->drupalGet('admin'); - $this->assertEscaped($this->adminUser->getUsername(), 'Found the custom 403 page'); + $this->assertText($this->adminUser->getUsername(), 'Found the custom 403 page'); $this->assertText(t('Username'), 'Blocks are shown on the custom 403 page'); // Log back in and remove the custom 403 page.