You are here

function MenuIncTestCase::testMenuSetItem in SimpleTest 7

Test menu_set_item().

File

tests/menu.test, line 216
Provides SimpleTests for menu.inc.

Class

MenuIncTestCase
@file Provides SimpleTests for menu.inc.

Code

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