You are here

protected function ContentTranslationUITestBase::getValue 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::getValue()

Returns the value for the specified property in the given language.

Parameters

\Drupal\Core\Entity\EntityInterface $translation: The translation object the property value should be retrieved from.

string $property: The property name.

string $langcode: The property value.

Return value

The property value.

1 call to ContentTranslationUITestBase::getValue()
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 451
Contains \Drupal\content_translation\Tests\ContentTranslationUITestBase.

Class

ContentTranslationUITestBase
Tests the Content Translation UI.

Namespace

Drupal\content_translation\Tests

Code

protected function getValue(EntityInterface $translation, $property, $langcode) {
  $key = $property == 'user_id' ? 'target_id' : 'value';
  return $translation
    ->get($property)->{$key};
}