Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / filter / tests / src / Functional / FilterFormTest.php
index fb0046b08a30cb811106aea9370ea7f1b0661825..5457912d91779e278379af6e3aeb63fa22bf007f 100644 (file)
@@ -2,7 +2,7 @@
 
 namespace Drupal\Tests\filter\Functional;
 
-use Drupal\Component\Utility\SafeMarkup;
+use Drupal\Component\Render\FormattableMarkup;
 use Drupal\filter\Entity\FilterFormat;
 use Drupal\Tests\BrowserTestBase;
 
@@ -72,7 +72,7 @@ class FilterFormTest extends BrowserTestBase {
     // @see https://www.drupal.org/node/2387983
     \Drupal::service('module_installer')->install(['filter_test_plugin']);
     // Force rebuild module data.
-    _system_rebuild_module_data();
+    \Drupal::service('extension.list.module')->reset();
   }
 
   /**
@@ -176,7 +176,7 @@ class FilterFormTest extends BrowserTestBase {
    */
   protected function assertNoSelect($id) {
     $select = $this->xpath('//select[@id=:id]', [':id' => $id]);
-    $this->assertEmpty($select, SafeMarkup::format('Field @id does not exist.', [
+    $this->assertEmpty($select, new FormattableMarkup('Field @id does not exist.', [
       '@id' => $id,
     ]));
   }
@@ -196,7 +196,7 @@ class FilterFormTest extends BrowserTestBase {
    */
   protected function assertOptions($id, array $expected_options, $selected) {
     $select = $this->xpath('//select[@id=:id]', [':id' => $id]);
-    $this->assertNotEmpty($select, SafeMarkup::format('Field @id exists.', [
+    $this->assertNotEmpty($select, new FormattableMarkup('Field @id exists.', [
       '@id' => $id,
     ]));
     $select = reset($select);
@@ -204,7 +204,7 @@ class FilterFormTest extends BrowserTestBase {
     foreach ($found_options as $found_key => $found_option) {
       $expected_key = array_search($found_option->getValue(), $expected_options);
       if ($expected_key !== FALSE) {
-        $this->pass(SafeMarkup::format('Option @option for field @id exists.', [
+        $this->pass(new FormattableMarkup('Option @option for field @id exists.', [
           '@option' => $expected_options[$expected_key],
           '@id' => $id,
         ]));
@@ -216,13 +216,13 @@ class FilterFormTest extends BrowserTestBase {
     // Make sure that all expected options were found and that there are no
     // unexpected options.
     foreach ($expected_options as $expected_option) {
-      $this->fail(SafeMarkup::format('Option @option for field @id exists.', [
+      $this->fail(new FormattableMarkup('Option @option for field @id exists.', [
         '@option' => $expected_option,
         '@id' => $id,
       ]));
     }
     foreach ($found_options as $found_option) {
-      $this->fail(SafeMarkup::format('Option @option for field @id does not exist.', [
+      $this->fail(new FormattableMarkup('Option @option for field @id does not exist.', [
         '@option' => $found_option->getValue(),
         '@id' => $id,
       ]));
@@ -247,7 +247,7 @@ class FilterFormTest extends BrowserTestBase {
     $select = $this->xpath('//select[@id=:id and contains(@required, "required")]', [
       ':id' => $id,
     ]);
-    $this->assertNotEmpty($select, SafeMarkup::format('Required field @id exists.', [
+    $this->assertNotEmpty($select, new FormattableMarkup('Required field @id exists.', [
       '@id' => $id,
     ]));
     // A required select element has a "- Select -" option whose key is an empty
@@ -269,7 +269,7 @@ class FilterFormTest extends BrowserTestBase {
     $textarea = $this->xpath('//textarea[@id=:id and not(contains(@disabled, "disabled"))]', [
       ':id' => $id,
     ]);
-    $this->assertNotEmpty($textarea, SafeMarkup::format('Enabled field @id exists.', [
+    $this->assertNotEmpty($textarea, new FormattableMarkup('Enabled field @id exists.', [
       '@id' => $id,
     ]));
   }
@@ -287,12 +287,12 @@ class FilterFormTest extends BrowserTestBase {
     $textarea = $this->xpath('//textarea[@id=:id and contains(@disabled, "disabled")]', [
       ':id' => $id,
     ]);
-    $this->assertNotEmpty($textarea, SafeMarkup::format('Disabled field @id exists.', [
+    $this->assertNotEmpty($textarea, new FormattableMarkup('Disabled field @id exists.', [
       '@id' => $id,
     ]));
     $textarea = reset($textarea);
     $expected = 'This field has been disabled because you do not have sufficient permissions to edit it.';
-    $this->assertEqual($textarea->getText(), $expected, SafeMarkup::format('Disabled textarea @id hides text in an inaccessible text format.', [
+    $this->assertEqual($textarea->getText(), $expected, new FormattableMarkup('Disabled textarea @id hides text in an inaccessible text format.', [
       '@id' => $id,
     ]));
     // Make sure the text format select is not shown.