1.20.x menu.test MenuRouterTestCase::testMenuSetItem()

Test menu_set_item().

File

modules/simpletest/tests/menu.test, line 450
Provides SimpleTests for menu.inc.

Class

MenuRouterTestCase

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');
}