X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fcomment%2Ftests%2Fsrc%2FFunctional%2FCommentBlockTest.php;h=b3ee6b8cfb584df88efcf5aec866c1160686f159;hb=5b8bb166bfa98770daef9de5c127fc2e6ef02340;hp=db7d1bd82722d8efb8d7d6d19a075110481db9b2;hpb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;p=yaffs-website diff --git a/web/core/modules/comment/tests/src/Functional/CommentBlockTest.php b/web/core/modules/comment/tests/src/Functional/CommentBlockTest.php index db7d1bd82..b3ee6b8cf 100644 --- a/web/core/modules/comment/tests/src/Functional/CommentBlockTest.php +++ b/web/core/modules/comment/tests/src/Functional/CommentBlockTest.php @@ -2,7 +2,7 @@ namespace Drupal\Tests\comment\Functional; -use Drupal\Component\Utility\SafeMarkup; +use Drupal\Component\Render\FormattableMarkup; use Drupal\user\RoleInterface; /** @@ -68,13 +68,13 @@ class CommentBlockTest extends CommentTestBase { // Test the only the 10 latest comments are shown and in the proper order. $this->assertNoText($comments[10]->getSubject(), 'Comment 11 not found in block.'); for ($i = 0; $i < 10; $i++) { - $this->assertText($comments[$i]->getSubject(), SafeMarkup::format('Comment @number found in block.', ['@number' => 10 - $i])); + $this->assertText($comments[$i]->getSubject(), new FormattableMarkup('Comment @number found in block.', ['@number' => 10 - $i])); if ($i > 1) { $previous_position = $position; - $position = strpos($this->getRawContent(), $comments[$i]->getSubject()); - $this->assertTrue($position > $previous_position, SafeMarkup::format('Comment @a appears after comment @b', ['@a' => 10 - $i, '@b' => 11 - $i])); + $position = strpos($this->getSession()->getPage()->getContent(), $comments[$i]->getSubject()); + $this->assertTrue($position > $previous_position, new FormattableMarkup('Comment @a appears after comment @b', ['@a' => 10 - $i, '@b' => 11 - $i])); } - $position = strpos($this->getRawContent(), $comments[$i]->getSubject()); + $position = strpos($this->getSession()->getPage()->getContent(), $comments[$i]->getSubject()); } // Test that links to comments work when comments are across pages.