Commit d107fb98 authored by Dries's avatar Dries
Browse files

- Patch #784856 by dmitrig01: menu_get_names() is dead code, remove it.

parent cb36fd3c
......@@ -1691,22 +1691,6 @@ function menu_set_custom_theme() {
menu_get_custom_theme(TRUE);
}
/**
* Build a list of named menus.
*/
function menu_get_names() {
$names = &drupal_static(__FUNCTION__);
if (empty($names)) {
$names = db_select('menu_links')
->distinct()
->fields('menu_links', array('menu_name'))
->orderBy('menu_name')
->execute()->fetchCol();
}
return $names;
}
/**
* Return an array containing the names of system-defined (default) menus.
*/
......
......@@ -247,31 +247,6 @@ class MenuRouterTestCase extends DrupalWebTestCase {
$this->assertLink(t('Menu link #2'), 0, t('Found menu link #2'));
}
/**
* Test menu_get_names().
*/
function testMenuGetNames() {
// Create three menu items.
for ($i = 0; $i < 3; $i++) {
$menu_link = array(
'link_title' => 'Menu link #' . $i,
'link_path' => 'menu_test/' . $i,
'module' => 'menu_test',
'menu_name' => 'menu_test_' . $i,
);
menu_link_save($menu_link);
}
drupal_static_reset('menu_get_names');
// Verify that the menu names are correctly reported by menu_get_names().
$menu_names = menu_get_names();
$this->pass(implode(' | ', $menu_names));
for ($i = 0; $i < 3; $i++) {
$this->assertTrue(in_array('menu_test_' . $i, $menu_names), t('Expected menu name %expected is returned.', array('%expected' => 'menu_test_' . $i)));
}
}
/**
* Tests for menu_name parameter for hook_menu().
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment