Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / views_ui / tests / src / Functional / DisplayPathTest.php
similarity index 94%
rename from web/core/modules/views_ui/src/Tests/DisplayPathTest.php
rename to web/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php
index d1d1732bababa81bc4a054a8ffb0685fa6ccbf9d..f8e58e719c70f79c8d9b62f91fabba76a26ce8dd 100644 (file)
@@ -1,8 +1,10 @@
 <?php
 
-namespace Drupal\views_ui\Tests;
+namespace Drupal\Tests\views_ui\Functional;
+
 use Drupal\Core\Menu\MenuTreeParameters;
 use Drupal\menu_link_content\Entity\MenuLinkContent;
+use Drupal\system\Tests\Cache\AssertPageCacheContextsAndTagsTrait;
 
 /**
  * Tests the UI of generic display path plugin.
@@ -11,11 +13,12 @@ use Drupal\menu_link_content\Entity\MenuLinkContent;
  * @see \Drupal\views\Plugin\views\display\PathPluginBase
  */
 class DisplayPathTest extends UITestBase {
+  use AssertPageCacheContextsAndTagsTrait;
 
-  protected function setUp() {
-    parent::setUp();
+  protected function setUp($import_test_views = TRUE) {
+    parent::setUp($import_test_views);
 
-    $this->drupalPlaceBlock('page_title_block');
+    $this->placeBlock('page_title_block');
   }
 
   /**
@@ -158,9 +161,14 @@ class DisplayPathTest extends UITestBase {
     $this->drupalGet('admin/structure/views/nojs/display/test_page_display_menu/page_5/menu');
     $this->assertResponse(200);
     $menu_parent = $this->xpath('//select[@id="edit-menu-parent"]');
-    $menu_options = (array) $menu_parent[0]->option;
+    $menu_options = (array) $menu_parent[0]->findAll('css', 'option');
     unset($menu_options['@attributes']);
 
+    // Convert array to make the next assertion possible.
+    $menu_options = array_map(function($element) {
+      return $element->getText();
+    }, $menu_options);
+
     $this->assertEqual([
       '<User account menu>',
       '-- My account',