| 7 menu.test | MenuLinksUnitTestCase::assertMenuLinkParents($links, $expected_hierarchy) |
| 8 menu.test | MenuLinksUnitTestCase::assertMenuLinkParents($links, $expected_hierarchy) |
Assert that at set of links is properly parented.
File
- modules/
simpletest/ tests/ menu.test, line 740 - Provides SimpleTests for menu.inc.
Code
function assertMenuLinkParents($links, $expected_hierarchy) {
foreach ($expected_hierarchy as $child => $parent) {
$mlid = $links[$child]['mlid'];
$plid = $parent ? $links[$parent]['mlid'] : 0;
$menu_link = menu_link_load($mlid);
menu_link_save($menu_link);
$this->assertEqual($menu_link['plid'], $plid, t('Menu link %mlid has parent of %plid, expected %expected_plid.', array('%mlid' => $mlid, '%plid' => $menu_link['plid'], '%expected_plid' => $plid)));
}
}
Login or register to post comments