1 menu.test | MenuTestCase::verifyMenuLink($item, $item_node, $parent = NULL, $parent_node = NULL) |
Verify a menu link using the menu module UI.
Parameters
array $item Menu link.:
object $item_node Menu link content node.:
array $parent Parent menu link.:
object $parent_node Parent menu link content node.:
File
- core/
modules/ menu/ tests/ menu.test, line 399 - Tests for menu.module.
Class
Code
function verifyMenuLink($item, $item_node, $parent = NULL, $parent_node = NULL) {
// View user page.
$this->backdropGet('user');
$this->assertResponse(200);
// Verify parent menu link.
if (isset($parent)) {
// Verify menu link.
$title = $parent['link_title'];
$this->assertLink($title, 0, 'Parent menu link was displayed');
// Verify menu link.
$this->clickLink($title);
$title = $parent_node->title;
$this->assertTitle(t("@title | Backdrop CMS", array('@title' => $title)), 'Parent menu link link target was correct');
}
// Verify menu link.
$title = $item['link_title'];
$this->assertLink($title, 0, 'Menu link was displayed');
// Verify menu link link.
$this->clickLink($title);
$title = $item_node->title;
$this->assertTitle(t("@title | Backdrop CMS", array('@title' => $title)), 'Menu link link target was correct');
}