You are here

private function MenuUiTest::getStandardMenuLink in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/menu_ui/tests/src/Functional/MenuUiTest.php \Drupal\Tests\menu_ui\Functional\MenuUiTest::getStandardMenuLink()

Returns standard menu link.

Return value

\Drupal\Core\Menu\MenuLinkInterface A menu link plugin.

2 calls to MenuUiTest::getStandardMenuLink()
MenuUiTest::testMenu in core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
Tests menu functionality using the admin and user interfaces.
MenuUiTest::verifyAccess in core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
Verifies the logged in user has the desired access to various menu pages.

File

core/modules/menu_ui/tests/src/Functional/MenuUiTest.php, line 964

Class

MenuUiTest
Add a custom menu, add menu links to the custom menu and Tools menu, check their data, and delete them using the UI.

Namespace

Drupal\Tests\menu_ui\Functional

Code

private function getStandardMenuLink() {

  // Retrieve menu link id of the Log out menu link, which will always be on
  // the front page.

  /** @var \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager */
  $menu_link_manager = \Drupal::service('plugin.manager.menu.link');
  $instance = $menu_link_manager
    ->getInstance([
    'id' => 'user.logout',
  ]);
  $this
    ->assertTrue((bool) $instance, 'Standard menu link was loaded');
  return $instance;
}