Skip to content
Snippets Groups Projects
Commit 6b040974 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #293511 by cwgordon7, catch, dereine, Wisif, ThiOz: added a test for...

- Patch #293511 by cwgordon7, catch, dereine, Wisif, ThiOz: added a test for menu_get_item() and menu_set_item().
parent 8ba2805c
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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');
}
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment