function i18nMenuTestCase::createMenuLinkTranslationSet in Internationalization 7
Helper function to create a translation set.
2 calls to i18nMenuTestCase::createMenuLinkTranslationSet()
- i18nMenuTestCase::testMenuTranslateLocalizeSwitchToNonTranslatable in i18n_menu/
i18n_menu.test - Tests if on a switch from translatable to non translatable the translation sets and links are cleaned up.
- i18nMenuTestCase::testMenuTranslationSets in i18n_menu/
i18n_menu.test - Tests if the translation set management works.
File
- i18n_menu/
i18n_menu.test, line 280 - Test case for multilingual menus.
Class
- i18nMenuTestCase
- @file Test case for multilingual menus.
Code
function createMenuLinkTranslationSet($edit = array()) {
$edit += array(
'title' => $this
->randomName(16),
);
$this
->drupalPost('admin/structure/menu/manage/translation/add', $edit, t('Save'));
// Load translation set entity.
$entity = entity_load('i18n_translation', FALSE, array(
'title' => $edit['title'],
), TRUE);
if (empty($entity)) {
$this
->fail('Could not create a translation set.', 'i18n_translation');
return FALSE;
}
return reset($entity);
}