function MenuLinkContentTranslationUITest::doTestTranslationEdit
Same name in other branches
- 9 core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php \Drupal\Tests\menu_link_content\Functional\MenuLinkContentTranslationUITest::doTestTranslationEdit()
- 8.9.x core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php \Drupal\Tests\menu_link_content\Functional\MenuLinkContentTranslationUITest::doTestTranslationEdit()
- 10 core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php \Drupal\Tests\menu_link_content\Functional\MenuLinkContentTranslationUITest::doTestTranslationEdit()
Overrides ContentTranslationUITestBase::doTestTranslationEdit
File
-
core/
modules/ menu_link_content/ tests/ src/ Functional/ MenuLinkContentTranslationUITest.php, line 113
Class
- MenuLinkContentTranslationUITest
- Tests the menu link content translation UI.
Namespace
Drupal\Tests\menu_link_content\FunctionalCode
protected function doTestTranslationEdit() : void {
$storage = $this->container
->get('entity_type.manager')
->getStorage($this->entityTypeId);
$storage->resetCache([
$this->entityId,
]);
$entity = $storage->load($this->entityId);
$languages = $this->container
->get('language_manager')
->getLanguages();
foreach ($this->langcodes as $langcode) {
// We only want to test the title for non-english translations.
if ($langcode != 'en') {
$options = [
'language' => $languages[$langcode],
];
$url = $entity->toUrl('edit-form', $options);
$this->drupalGet($url);
$this->assertSession()
->pageTextContains("{$entity->getTranslation($langcode)->label()} [{$languages[$langcode]->getName()} translation]");
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.