function MenuTranslationHierarchyBaseTestCase::createMenu in Language Hierarchy 7
Helper function to create a menu.
1 call to MenuTranslationHierarchyBaseTestCase::createMenu()
- MenuTranslationHierarchyWebTestCase::testMenuTranslateLocalize in modules/
i18n_menu_hierarchy/ tests/ i18n_menu_hierarchy.test
File
- modules/
i18n_menu_hierarchy/ tests/ i18n_menu_hierarchy.test, line 32 - Tests for Menu Translation Hierarchy module.
Class
- MenuTranslationHierarchyBaseTestCase
- Base class for Menu Translation Hierarchy module tests.
Code
function createMenu($edit = array()) {
$edit += array(
'title' => $this
->randomName(),
'menu_name' => substr(hash('sha256', $this
->randomName(16)), 0, MENU_MAX_MENU_NAME_LENGTH_UI),
'language' => LANGUAGE_NONE,
);
$this
->drupalPost('admin/structure/menu/add', $edit, t('Save'));
return menu_load('menu-' . $edit['menu_name']);
}