You are here

protected function ContentTranslationUITestBase::getEditValues in Drupal 8

Same name in this branch
  1. 8 core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php \Drupal\content_translation\Tests\ContentTranslationUITestBase::getEditValues()
  2. 8 core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php \Drupal\Tests\content_translation\Functional\ContentTranslationUITestBase::getEditValues()

Returns an edit array containing the values to be posted.

1 call to ContentTranslationUITestBase::getEditValues()
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 400

Class

ContentTranslationUITestBase
Tests the Content Translation UI.

Namespace

Drupal\content_translation\Tests

Code

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