diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-05-17 07:49:13 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-05-17 07:49:13 +0000 |
commit | 6b040974d30b333d8ef284270d9fb78d764fc3e6 (patch) | |
tree | 45ce6683d06e59c834e27809e6febb99ec1badca /modules/simpletest/tests/menu.test | |
parent | 8ba2805c91b7997c860fba160352c9ef05821f32 (diff) | |
download | brdo-6b040974d30b333d8ef284270d9fb78d764fc3e6.tar.gz brdo-6b040974d30b333d8ef284270d9fb78d764fc3e6.tar.bz2 |
- Patch #293511 by cwgordon7, catch, dereine, Wisif, ThiOz: added a test for menu_get_item() and menu_set_item().
Diffstat (limited to 'modules/simpletest/tests/menu.test')
-rw-r--r-- | modules/simpletest/tests/menu.test | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/simpletest/tests/menu.test b/modules/simpletest/tests/menu.test index 68257b3b1..95674127e 100644 --- a/modules/simpletest/tests/menu.test +++ b/modules/simpletest/tests/menu.test @@ -105,6 +105,24 @@ class MenuIncTestCase extends DrupalWebTestCase { $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.')); } + + /** + * Test menu_set_item(). + */ + function testMenuSetItem() { + $item = menu_get_item('node'); + + $this->assertEqual($item['path'], 'node', t("Path from menu_get_item('node') is equal to 'node'"), 'menu'); + + // Modify the path for the item then save it. + $item['path'] = 'node_test'; + $item['href'] = 'node_test'; + + menu_set_item('node', $item); + $compare_item = menu_get_item('node'); + $this->assertEqual($compare_item, $item, t('Modified menu item is equal to newly retrieved menu item.'), 'menu'); + } + } /** |