diff -u b/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarAdminMenuTest.php b/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarAdminMenuTest.php --- b/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarAdminMenuTest.php +++ b/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarAdminMenuTest.php @@ -331,8 +331,8 @@ // Request a new page to refresh the drupalSettings object. $subtrees_hash = $this->getSubtreesHash(); - $ajax_result = $this->drupalGet('toolbar/subtrees/' . $subtrees_hash, ['query' => [MainContentViewSubscriber::WRAPPER_FORMAT => 'drupal_ajax']]); - $ajax_result = json_decode($ajax_result, TRUE); + $this->drupalGet('toolbar/subtrees/' . $subtrees_hash, ['query' => [MainContentViewSubscriber::WRAPPER_FORMAT => 'drupal_ajax']]); + $ajax_result = json_decode($this->xpath('//textarea')[0]->getValue(), 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.');