- $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]));