Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / comment / tests / src / Functional / CommentBlockTest.php
index db7d1bd82722d8efb8d7d6d19a075110481db9b2..b3ee6b8cfb584df88efcf5aec866c1160686f159 100644 (file)
@@ -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.