// Verify expected breadcrumbs for menu links.
$trail =
$home;
$tree =
[];
// Logout the user because we want to check the active class as well, which
// is just rendered as anonymous user.
$this->
drupalLogout();
foreach ($tags as $name =>
$data) { $term =
$data['term'
];
/** @var \Drupal\menu_link_content\MenuLinkContentInterface $link */
$link =
$data['link'
];
$link_path =
$link->
getUrlObject()->
getInternalPath();
$tree +=
[ $link_path =>
$link->
getTitle(),
];
$this->
assertBreadcrumb($link_path,
$trail,
$term->
getName(),
$tree, TRUE, 'menu__item--active-trail'
);
// Ensure that the tagged node is found.
$this->
assertSession()->
assertEscaped($parent->
getTitle());
// Additionally make sure that this link appears only once; i.e., the
// untranslated menu links automatically generated from menu router items
// ('taxonomy/term/%') should never be translated and appear in any menu
// other than the breadcrumb trail.