function MenuIncTestCase::testMenuItemHooks in SimpleTest 7
Test menu maintainance hooks.
File
Class
- MenuIncTestCase
- @file Provides SimpleTests for menu.inc.
Code
function testMenuItemHooks() {
// Create an item.
menu_link_maintain('menu_test', 'insert', 'menu_test_maintain/4', 'Menu link #4');
$this
->assertEqual(menu_test_static_variable(), 'insert', t('hook_menu_link_insert() fired correctly'));
// Update the item.
menu_link_maintain('menu_test', 'update', 'menu_test_maintain/4', 'Menu link updated');
$this
->assertEqual(menu_test_static_variable(), 'update', t('hook_menu_link_update() fired correctly'));
// Delete the item.
menu_link_maintain('menu_test', 'delete', 'menu_test_maintain/4', '');
$this
->assertEqual(menu_test_static_variable(), 'delete', t('hook_menu_link_delete() fired correctly'));
}