Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / tests / Drupal / KernelTests / Component / Utility / SafeMarkupKernelTest.php
index 8fab30727e2a74b8be81b220c452599725ea64bd..3028b62dd0270f75db63d6ded5b43e5d6819d7a1 100644 (file)
@@ -2,7 +2,7 @@
 
 namespace Drupal\KernelTests\Component\Utility;
 
-use Drupal\Component\Utility\SafeMarkup;
+use Drupal\Component\Render\FormattableMarkup;
 use Drupal\Core\Url;
 use Drupal\KernelTests\KernelTestBase;
 
@@ -28,7 +28,7 @@ class SafeMarkupKernelTest extends KernelTestBase {
   }
 
   /**
-   * Gets arguments for SafeMarkup::format() based on Url::fromUri() parameters.
+   * Gets arguments for FormattableMarkup based on Url::fromUri() parameters.
    *
    * @param string $uri
    *   The URI of the resource.
@@ -38,6 +38,8 @@ class SafeMarkupKernelTest extends KernelTestBase {
    * @return array
    *   Array containing:
    *   - ':url': A URL string.
+   *
+   * @see \Drupal\Component\Render\FormattableMarkup
    */
   protected static function getSafeMarkupUriArgs($uri, $options = []) {
     $args[':url'] = Url::fromUri($uri, $options)->toString();
@@ -45,13 +47,13 @@ class SafeMarkupKernelTest extends KernelTestBase {
   }
 
   /**
-   * Tests URL ":placeholders" in SafeMarkup::format().
+   * Tests URL ":placeholders" in \Drupal\Component\Render\FormattableMarkup.
    *
    * @dataProvider providerTestSafeMarkupUri
    */
   public function testSafeMarkupUri($string, $uri, $options, $expected) {
     $args = self::getSafeMarkupUriArgs($uri, $options);
-    $this->assertEquals($expected, SafeMarkup::format($string, $args));
+    $this->assertEquals($expected, new FormattableMarkup($string, $args));
   }
 
   /**
@@ -113,7 +115,7 @@ class SafeMarkupKernelTest extends KernelTestBase {
     $this->setExpectedException(\InvalidArgumentException::class);
     $args = self::getSafeMarkupUriArgs($uri);
 
-    SafeMarkup::format($string, $args);
+    new FormattableMarkup($string, $args);
   }
 
   /**