You are here

private function MenuTest::getStandardMenuLink in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/menu_ui/src/Tests/MenuTest.php \Drupal\menu_ui\Tests\MenuTest::getStandardMenuLink()

Returns standard menu link.

Return value

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

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

File

core/modules/menu_ui/src/Tests/MenuTest.php, line 890
Contains \Drupal\menu_ui\Tests\MenuTest.

Class

MenuTest
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\menu_ui\Tests

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;
}