function DevelToolbarTest::getMenuLinkInfos
Same name in other branches
- 4.x tests/src/Functional/DevelToolbarTest.php \Drupal\Tests\devel\Functional\DevelToolbarTest::getMenuLinkInfos()
Helper function for retrieve the menu link informations.
Return value
array An array containing the menu link informations.
2 calls to DevelToolbarTest::getMenuLinkInfos()
- DevelToolbarTest::testConfigurationForm in tests/
src/ Functional/ DevelToolbarTest.php - Tests configuration form.
- DevelToolbarTest::testToolbarIntegration in tests/
src/ Functional/ DevelToolbarTest.php - Tests toolbar integration.
File
-
tests/
src/ Functional/ DevelToolbarTest.php, line 253
Class
- DevelToolbarTest
- Tests devel toolbar module functionality.
Namespace
Drupal\Tests\devel\FunctionalCode
protected function getMenuLinkInfos() {
$parameters = new MenuTreeParameters();
$parameters->onlyEnabledLinks()
->setTopLevelOnly();
$tree = \Drupal::menuTree()->load('devel', $parameters);
$links = [];
foreach ($tree as $element) {
$links[] = [
'id' => $element->link
->getPluginId(),
'title' => $element->link
->getTitle(),
'url' => $element->link
->getUrlObject()
->toString(),
];
}
return $links;
}