function MenuRouterTestCase::testMenuSetItem
Test menu_set_item().
File
-
modules/
simpletest/ tests/ menu.test, line 524
Class
Code
function testMenuSetItem() {
$item = menu_get_item('node');
$this->assertEqual($item['path'], 'node', "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, 'Modified menu item is equal to newly retrieved menu item.', 'menu');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.