You are here

protected function ContentTranslationUITestBase::getTranslation in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php \Drupal\content_translation\Tests\ContentTranslationUITestBase::getTranslation()

Returns the translation object to use to retrieve the translated values.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity being tested.

string $langcode: The language code identifying the translation to be retrieved.

Return value

\Drupal\Core\TypedData\TranslatableInterface The translation object to act on.

1 call to ContentTranslationUITestBase::getTranslation()
ContentTranslationUITestBase::doTestBasicTranslation in core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php
Tests the basic translation workflow.

File

core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php, line 434
Contains \Drupal\content_translation\Tests\ContentTranslationUITestBase.

Class

ContentTranslationUITestBase
Tests the Content Translation UI.

Namespace

Drupal\content_translation\Tests

Code

protected function getTranslation(EntityInterface $entity, $langcode) {
  return $entity
    ->getTranslation($langcode);
}