protected function CommentTranslationUITest::doTestTranslationEdit in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/comment/src/Tests/CommentTranslationUITest.php \Drupal\comment\Tests\CommentTranslationUITest::doTestTranslationEdit()
Tests edit content translation.
Overrides ContentTranslationUITestBase::doTestTranslationEdit
File
- core/
modules/ comment/ src/ Tests/ CommentTranslationUITest.php, line 202 - Contains \Drupal\comment\Tests\CommentTranslationUITest.
Class
- CommentTranslationUITest
- Tests the Comment Translation UI.
Namespace
Drupal\comment\TestsCode
protected function doTestTranslationEdit() {
$entity = entity_load($this->entityTypeId, $this->entityId, TRUE);
$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 = array(
'language' => $languages[$langcode],
);
$url = $entity
->urlInfo('edit-form', $options);
$this
->drupalGet($url);
$title = t('Edit @type @title [%language translation]', array(
'@type' => $this->entityTypeId,
'@title' => $entity
->getTranslation($langcode)
->label(),
'%language' => $languages[$langcode]
->getName(),
));
$this
->assertRaw($title);
}
}
}