diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php index d3c62cc..44c9757 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php @@ -155,11 +155,6 @@ function testBreadCrumbs() { $this->assertBreadcrumb("node/$nid1", $trail); // Also verify that the node does not appear elsewhere (e.g., menu trees). $this->assertNoLink($node1->getTitle()); - // The node itself should not be contained in the breadcrumb on the default - // local task, since there is no difference between both pages. - $this->assertBreadcrumb("node/$nid1/view", $trail); - // Also verify that the node does not appear elsewhere (e.g., menu trees). - $this->assertNoLink($node1->getTitle()); $trail += array( "node/$nid1" => $node1->getTitle(), @@ -201,48 +196,17 @@ function testBreadCrumbs() { "node/$nid2" => $node2->menu['link_title'], ); $this->assertBreadcrumb("node/$nid2", $trail, $node2->getTitle(), $tree); - // The node itself should not be contained in the breadcrumb on the - // default local task, since there is no difference between both pages. - $this->assertBreadcrumb("node/$nid2/view", $trail, $node2->getTitle(), $tree); $trail += array( "node/$nid2" => $node2->menu['link_title'], ); $this->assertBreadcrumb("node/$nid2/edit", $trail); - // Create a child node in the current menu. - $title = $this->randomName(); - $node3 = $this->drupalCreateNode(array( - 'type' => $type, - 'title' => $title, - 'menu' => entity_create('menu_link', array( - 'enabled' => 1, - 'link_title' => 'Child ' . $title, - 'description' => '', - 'menu_name' => $menu, - 'plid' => $node2->menu['mlid'], - )), - )); - $nid3 = $node3->id(); - - $this->assertBreadcrumb("node/$nid3", $trail, $node3->getTitle(), $tree, FALSE); - // The node itself should not be contained in the breadcrumb on the - // default local task, since there is no difference between both pages. - $this->assertBreadcrumb("node/$nid3/view", $trail, $node3->getTitle(), $tree, FALSE); - $trail += array( - "node/$nid3" => $node3->menu['link_title'], - ); - $tree += array( - "node/$nid3" => $node3->menu['link_title'], - ); - $this->assertBreadcrumb("node/$nid3/edit", $trail); - // Verify that node listing page still contains "Home" only. $trail = array(); $this->assertBreadcrumb('node', $trail); if ($menu == 'tools') { $parent = $node2; - $child = $node3; } } @@ -271,9 +235,6 @@ function testBreadCrumbs() { $trail += array( 'node/' . $parent->id() => $parent->menu['link_title'], ); - $tree += array( - 'node/' . $parent->id() => $child->menu['link_title'], - ); // Add a taxonomy term/tag to last node, and add a link for that term to the // Tools menu. diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/MenuTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuTestBase.php index 7d23727..3c6578e 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/MenuTestBase.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuTestBase.php @@ -59,8 +59,9 @@ protected function assertBreadcrumbParts($trail) { // Compare paths with actual breadcrumb. $parts = $this->getBreadcrumbParts(); $pass = TRUE; - // There may be more than one breadcrumb on the page. - while (!empty($parts)) { + // There may be more than one breadcrumb on the page. If $trail is empty + // this test would go into an infinte loop, so we need to check that too. + while ($trail && !empty($parts)) { foreach ($trail as $path => $title) { $url = url($path); $part = array_shift($parts);