diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-03-14 20:56:06 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-03-14 20:56:06 +0000 |
commit | 56e1c5d106f9d1fa520c16803d812e7bca02e4b3 (patch) | |
tree | 93329551df2aa3d13adb87677bd9cda4b33737c6 /modules/simpletest/tests/menu.test | |
parent | 3a7047c670399f4dcd4033920004e1123edeec3e (diff) | |
download | brdo-56e1c5d106f9d1fa520c16803d812e7bca02e4b3.tar.gz brdo-56e1c5d106f9d1fa520c16803d812e7bca02e4b3.tar.bz2 |
- Patch #401922 by Damien Tournoud: fixed parent link detection.
Diffstat (limited to 'modules/simpletest/tests/menu.test')
-rw-r--r-- | modules/simpletest/tests/menu.test | 12 |
1 files changed, 12 insertions, 0 deletions
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.')); + } } /** |