function ConfigTestTranslationUITest::testTranslationUI

Overrides EntityTranslationTest::testTranslationUI().

@todo This override is a copy-paste of parts of the parent method. Turn ConfigTest into a properly translatable entity and remove this override.

Overrides EntityTranslationUITest::testTranslationUI

File

drupal/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/ConfigTestTranslationUITest.php, line 62
Definition of Drupal\entity\Tests\ConfigTestTranslationUITest.

Class

ConfigTestTranslationUITest
Tests the Config Test Translation UI.

Namespace

Drupal\translation_entity\Tests

Code

function testTranslationUI() {

  // Create a new test entity with original values in the default language.
  $default_langcode = $this->langcodes[0];
  $values[$default_langcode] = $this
    ->getNewEntityValues($default_langcode);
  $id = $this
    ->createEntity($values[$default_langcode], $default_langcode);
  $entity = entity_load($this->entityType, $id, TRUE);
  $this
    ->assertTrue($entity, t('Entity found in the database.'));
  $translation = $this
    ->getTranslation($entity, $default_langcode);
  foreach ($values[$default_langcode] as $property => $value) {
    $stored_value = $this
      ->getValue($translation, $property, $default_langcode);
    $value = is_array($value) ? $value[0]['value'] : $value;
    $message = format_string('@property correctly stored in the default language.', array(
      '@property' => $property,
    ));
    $this
      ->assertIdentical($stored_value, $value, $message);
  }
}