Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / views_ui / tests / src / Functional / HandlerTest.php
index 31829941fc73c73e7a5c700e84b3ee9e1b482b75..7d96d0c5b57ad7404541e9481c2b36c7d688402b 100644 (file)
@@ -2,7 +2,7 @@
 
 namespace Drupal\Tests\views_ui\Functional;
 
-use Drupal\Component\Utility\SafeMarkup;
+use Drupal\Component\Render\FormattableMarkup;
 use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\views\Tests\ViewTestData;
@@ -53,7 +53,7 @@ class HandlerTest extends UITestBase {
       'type' => 'int',
       'unsigned' => TRUE,
       'not null' => TRUE,
-      'default' => 0
+      'default' => 0,
     ];
 
     return $schema;
@@ -74,8 +74,8 @@ class HandlerTest extends UITestBase {
       'relationship' => [
         'id' => 'standard',
         'base' => 'users_field_data',
-        'base field' => 'uid'
-      ]
+        'base field' => 'uid',
+      ],
     ];
 
     // Create a dummy field with no help text.
@@ -180,14 +180,14 @@ class HandlerTest extends UITestBase {
       'field_name' => 'field_test',
       'entity_type' => 'node',
       'bundle' => 'page',
-      'label' => 'The giraffe" label'
+      'label' => 'The giraffe" label',
     ])->save();
 
     FieldConfig::create([
       'field_name' => 'field_test',
       'entity_type' => 'node',
       'bundle' => 'article',
-      'label' => 'The <em>giraffe"</em> label <script>alert("the return of the xss")</script>'
+      'label' => 'The <em>giraffe"</em> label <script>alert("the return of the xss")</script>',
     ])->save();
 
     $this->drupalGet('admin/structure/views/nojs/add-handler/content/default/field');
@@ -206,7 +206,7 @@ class HandlerTest extends UITestBase {
       $href = "admin/structure/views/nojs/handler/test_view_broken/default/$type/id_broken";
 
       $result = $this->xpath('//a[contains(@href, :href)]', [':href' => $href]);
-      $this->assertEqual(count($result), 1, SafeMarkup::format('Handler (%type) edit link found.', ['%type' => $type]));
+      $this->assertEqual(count($result), 1, new FormattableMarkup('Handler (%type) edit link found.', ['%type' => $type]));
 
       $text = 'Broken/missing handler';
 
@@ -225,7 +225,7 @@ class HandlerTest extends UITestBase {
       ];
 
       foreach ($original_configuration as $key => $value) {
-        $this->assertText(SafeMarkup::format('@key: @value', ['@key' => $key, '@value' => $value]));
+        $this->assertText(new FormattableMarkup('@key: @value', ['@key' => $key, '@value' => $value]));
       }
     }
   }