diff --git a/core/modules/toolbar/src/Tests/ToolbarAdminMenuTest.php b/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php similarity index 97% rename from core/modules/toolbar/src/Tests/ToolbarAdminMenuTest.php rename to core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php index dd4b5c4..36b6db9 100644 --- a/core/modules/toolbar/src/Tests/ToolbarAdminMenuTest.php +++ b/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php @@ -1,11 +1,12 @@ xpath('//textarea')); - $lid = (string) $textarea[0]['name']; + $lid = (string) $textarea->getAttribute('name'); $edit = [ $lid => $translation, ]; @@ -330,7 +331,8 @@ public function testSubtreesJsonRequest() { // Request a new page to refresh the drupalSettings object. $subtrees_hash = $this->getSubtreesHash(); - $ajax_result = $this->drupalGetAjax('toolbar/subtrees/' . $subtrees_hash); + $ajax_result = $this->drupalGet('toolbar/subtrees/' . $subtrees_hash, ['query' => [MainContentViewSubscriber::WRAPPER_FORMAT => 'drupal_ajax']]); + $ajax_result = json_decode($ajax_result, TRUE); $this->assertResponse('200'); $this->assertEqual($ajax_result[0]['command'], 'setToolbarSubtrees', 'Subtrees response uses the correct command.'); $this->assertEqual(array_keys($ajax_result[0]['subtrees']), ['system-admin_content', 'system-admin_structure', 'system-themes_page', 'system-modules_list', 'system-admin_config', 'entity-user-collection', 'front'], 'Correct subtrees returned.'); diff --git a/core/modules/toolbar/src/Tests/ToolbarCacheContextsTest.php b/core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php similarity index 97% rename from core/modules/toolbar/src/Tests/ToolbarCacheContextsTest.php rename to core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php index 6995d59..2f6f92d 100644 --- a/core/modules/toolbar/src/Tests/ToolbarCacheContextsTest.php +++ b/core/modules/toolbar/tests/src/Functional/ToolbarCacheContextsTest.php @@ -1,11 +1,11 @@ randomMachineName(); $textarea = current($this->xpath('//textarea')); - $lid = (string) $textarea[0]['name']; + $lid = (string) $textarea->getAttribute('name'); $edit = [ $lid => $menu_item_translated, ];