From 56e1c5d106f9d1fa520c16803d812e7bca02e4b3 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 14 Mar 2009 20:56:06 +0000 Subject: - Patch #401922 by Damien Tournoud: fixed parent link detection. --- modules/simpletest/tests/menu.test | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'modules/simpletest/tests/menu.test') diff --git a/modules/simpletest/tests/menu.test b/modules/simpletest/tests/menu.test index a4935c968..633945cfc 100644 --- a/modules/simpletest/tests/menu.test +++ b/modules/simpletest/tests/menu.test @@ -47,6 +47,18 @@ class MenuIncTestCase extends DrupalWebTestCase { $name = db_result(db_query($sql)); $this->assertEqual($name, 'changed', t('Menu name was successfully changed after rebuild.')); } + + /** + * Tests for menu hiearchy. + */ + function testMenuHiearchy() { + $parent_link = db_query("SELECT * FROM {menu_links} WHERE link_path = :link_path", array(':link_path' => 'menu-test/hierarchy/parent'))->fetchAssoc(); + $child_link = db_query("SELECT * FROM {menu_links} WHERE link_path = :link_path", array(':link_path' => 'menu-test/hierarchy/parent/child'))->fetchAssoc(); + $unattached_child_link = db_query("SELECT * FROM {menu_links} WHERE link_path = :link_path", array(':link_path' => 'menu-test/hierarchy/parent/child2/child'))->fetchAssoc(); + + $this->assertEqual($child_link['plid'], $parent_link['mlid'], t('The parent of a directly attached child is correct.')); + $this->assertEqual($unattached_child_link['plid'], $parent_link['mlid'], t('The parent of a non-directly attached child is correct.')); + } } /** -- cgit v1.2.3