diff core/modules/comment/tests/src/Functional/CommentBlockTest.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 4c8ae668cc8c
children
line wrap: on
line diff
--- a/core/modules/comment/tests/src/Functional/CommentBlockTest.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/core/modules/comment/tests/src/Functional/CommentBlockTest.php	Thu Feb 28 13:21:36 2019 +0000
@@ -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 @@
     // 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.