Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / web / core / modules / views / tests / src / Functional / Wizard / BasicTest.php
index eb2ddbbb677ea9ab14c39cc4e7770b51c11bbcb3..ad690ad77718b39a1a8b978d5cc8fb53f205028f 100644 (file)
@@ -3,7 +3,7 @@
 namespace Drupal\Tests\views\Functional\Wizard;
 
 use Drupal\Component\Serialization\Json;
-use Drupal\Component\Utility\SafeMarkup;
+use Drupal\Component\Render\FormattableMarkup;
 use Drupal\Core\Url;
 use Drupal\views\Views;
 
@@ -163,8 +163,9 @@ class BasicTest extends WizardTestBase {
     $this->drupalPostForm('admin/structure/views/add', $view4, t('Save and edit'));
     $this->assertRaw(t('The view %view has been saved.', ['%view' => $view4['label']]));
 
-    // Check that the REST export path works.
-    $this->drupalGet($view4['rest_export[path]']);
+    // Check that the REST export path works. JSON will work, as all core
+    // formats will be allowed. JSON and XML by default.
+    $this->drupalGet($view4['rest_export[path]'], ['query' => ['_format' => 'json']]);
     $this->assertResponse(200);
     $data = Json::decode($this->getSession()->getPage()->getContent());
     $this->assertEqual(count($data), 1, 'Only the node of type page is exported.');
@@ -195,7 +196,7 @@ class BasicTest extends WizardTestBase {
 
     foreach ($displays as $display) {
       foreach (['query', 'exposed_form', 'pager', 'style', 'row'] as $type) {
-        $this->assertFalse(empty($display['display_options'][$type]['options']), SafeMarkup::format('Default options found for @plugin.', ['@plugin' => $type]));
+        $this->assertFalse(empty($display['display_options'][$type]['options']), new FormattableMarkup('Default options found for @plugin.', ['@plugin' => $type]));
       }
     }
   }