Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / tests / Drupal / Tests / Component / Utility / SafeMarkupTest.php
index f811c16c15d82829d02f7d6642bfe5793abf7560..4e2850fe23b6f6b750f5c597a6400e8d2256dec7 100644 (file)
@@ -18,6 +18,7 @@ use PHPUnit\Framework\TestCase;
  * Tests marking strings as safe.
  *
  * @group Utility
+ * @group legacy
  * @coversDefaultClass \Drupal\Component\Utility\SafeMarkup
  */
 class SafeMarkupTest extends TestCase {
@@ -35,6 +36,7 @@ class SafeMarkupTest extends TestCase {
    * Tests SafeMarkup::isSafe() with different objects.
    *
    * @covers ::isSafe
+   * @expectedDeprecation SafeMarkup::isSafe() is scheduled for removal in Drupal 9.0.0. Instead, you should just check if a variable is an instance of \Drupal\Component\Render\MarkupInterface. See https://www.drupal.org/node/2549395.
    */
   public function testIsSafe() {
     $safe_string = $this->getMockBuilder('\Drupal\Component\Render\MarkupInterface')->getMock();
@@ -48,6 +50,7 @@ class SafeMarkupTest extends TestCase {
    *
    * @dataProvider providerCheckPlain
    * @covers ::checkPlain
+   * @expectedDeprecation SafeMarkup::checkPlain() is scheduled for removal in Drupal 9.0.0. Rely on Twig's auto-escaping feature, or use the @link theme_render #plain_text @endlink key when constructing a render array that contains plain text in order to use the renderer's auto-escaping feature. If neither of these are possible, \Drupal\Component\Utility\Html::escape() can be used in places where explicit escaping is needed. See https://www.drupal.org/node/2549395.
    *
    * @param string $text
    *   The text to provide to SafeMarkup::checkPlain().
@@ -107,6 +110,7 @@ class SafeMarkupTest extends TestCase {
    *
    * @dataProvider providerFormat
    * @covers ::format
+   * @expectedDeprecation SafeMarkup::format() is scheduled for removal in Drupal 9.0.0. Use \Drupal\Component\Render\FormattableMarkup. See https://www.drupal.org/node/2549395.
    *
    * @param string $string
    *   The string to run through SafeMarkup::format().
@@ -125,10 +129,6 @@ class SafeMarkupTest extends TestCase {
     $result = SafeMarkup::format($string, $args);
     $this->assertEquals($expected, (string) $result, $message);
     $this->assertEquals($expected_is_safe, $result instanceof MarkupInterface, 'SafeMarkup::format correctly sets the result as safe or not safe.');
-
-    foreach ($args as $arg) {
-      $this->assertSame($arg instanceof SafeMarkupTestMarkup, SafeMarkup::isSafe($arg));
-    }
   }
 
   /**