| 7 menu.test | MenuTreeDataTestCase::testMenuTreeData() |
| 8 menu.test | MenuTreeDataTestCase::testMenuTreeData() |
Validate the generation of a proper menu tree hierarchy.
File
- modules/
simpletest/ tests/ menu.test, line 954 - Provides SimpleTests for menu.inc.
Code
function testMenuTreeData() {
$tree = menu_tree_data($this->links);
// Validate that parent items #1, #2, and #5 exist on the root level.
$this->assertSameLink($this->links[1], $tree[1]['link'], t('Parent item #1 exists.'));
$this->assertSameLink($this->links[2], $tree[2]['link'], t('Parent item #2 exists.'));
$this->assertSameLink($this->links[5], $tree[5]['link'], t('Parent item #5 exists.'));
// Validate that child item #4 exists at the correct location in the hierarchy.
$this->assertSameLink($this->links[4], $tree[2]['below'][3]['below'][4]['link'], t('Child item #4 exists in the hierarchy.'));
}
Login or register to post comments