function MenuTestCase::getStandardMenuLink

Get standard menu link.

2 calls to MenuTestCase::getStandardMenuLink()
MenuTestCase::testMenu in modules/menu/menu.test
Login users, add menus and menu links, and test menu functionality through the admin and user interfaces.
MenuTestCase::verifyAccess in modules/menu/menu.test
Verify the logged in user has the desired access to the various menu nodes.

File

modules/menu/menu.test, line 577

Class

MenuTestCase
@file Tests for menu.module.

Code

private function getStandardMenuLink() {
    // Retrieve menu link id of the Log out menu link, which will always be on the front page.
    $mlid = db_query("SELECT mlid FROM {menu_links} WHERE module = 'system' AND router_path = 'user/logout'")->fetchField();
    $this->assertTrue($mlid > 0, 'Standard menu link id was found');
    // Load menu link.
    // Use api function so that link is translated for rendering.
    $item = menu_link_load($mlid);
    $this->assertTrue((bool) $item, 'Standard menu link was loaded');
    return $item;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.