protected function EntityTranslationUITest::getEditValues

Returns an edit array containing the values to be posted.

1 call to EntityTranslationUITest::getEditValues()
EntityTranslationUITest::testTranslationUI in drupal/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationUITest.php
Tests the basic translation UI.

File

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

Class

EntityTranslationUITest
Tests the Entity Translation UI.

Namespace

Drupal\translation_entity\Tests

Code

protected function getEditValues($values, $langcode, $new = FALSE) {
  $edit = $values[$langcode];
  $langcode = $new ? LANGUAGE_NOT_SPECIFIED : $langcode;
  foreach ($values[$langcode] as $property => $value) {
    if (is_array($value)) {
      $edit["{$property}[{$langcode}][0][value]"] = $value[0]['value'];
      unset($edit[$property]);
    }
  }
  return $edit;
}