public function MenuMultilingualTest::createCustomMenuItemTranslated in Menu Multilingual 8
Returns translated Custom Menu Items.
1 call to MenuMultilingualTest::createCustomMenuItemTranslated()
- MenuMultilingualTest::testCustomMenuItemTranslated in tests/
src/ Functional/ MenuMultilingualTest.php - Test for translated Custom Menu Items.
File
- tests/
src/ Functional/ MenuMultilingualTest.php, line 581
Class
- MenuMultilingualTest
- Class MenuMultilingualTest.
Namespace
Drupal\Tests\menu_multilingual\FunctionalCode
public function createCustomMenuItemTranslated(string $title, int $nid) {
$edit = [
'title[0][value]' => $title . ', English menu item',
'link[0][uri]' => '/node/' . $nid,
'langcode[0][value]' => 'en',
];
$this
->drupalGet('admin/structure/menu/manage/main/add');
$this
->submitForm($edit, 'Save');
$edit = [
'title[0][value]' => $title . ', French menu item',
'link[0][uri]' => '/node/' . $nid,
];
$this
->drupalGet('admin/structure/menu/item/' . $nid . '/edit/translations/add/en/fr');
$this
->submitForm($edit, 'Save');
}