function TermTranslationUITest::doTestTranslationEdit
Same name in other branches
- 9 core/modules/taxonomy/tests/src/Functional/TermTranslationUITest.php \Drupal\Tests\taxonomy\Functional\TermTranslationUITest::doTestTranslationEdit()
- 10 core/modules/taxonomy/tests/src/Functional/TermTranslationUITest.php \Drupal\Tests\taxonomy\Functional\TermTranslationUITest::doTestTranslationEdit()
- 11.x core/modules/taxonomy/tests/src/Functional/TermTranslationUITest.php \Drupal\Tests\taxonomy\Functional\TermTranslationUITest::doTestTranslationEdit()
Overrides ContentTranslationUITestBase::doTestTranslationEdit
File
-
core/
modules/ taxonomy/ tests/ src/ Functional/ TermTranslationUITest.php, line 147
Class
- TermTranslationUITest
- Tests the Term Translation UI.
Namespace
Drupal\Tests\taxonomy\FunctionalCode
protected function doTestTranslationEdit() {
$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);
$title = t('@title [%language translation]', [
'@title' => $entity->getTranslation($langcode)
->label(),
'%language' => $languages[$langcode]->getName(),
]);
$this->assertRaw($title);
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.