You are here

protected function TermTranslationUITest::getEditValues in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/taxonomy/src/Tests/TermTranslationUITest.php \Drupal\taxonomy\Tests\TermTranslationUITest::getEditValues()

Returns an edit array containing the values to be posted.

Overrides ContentTranslationUITestBase::getEditValues

File

core/modules/taxonomy/src/Tests/TermTranslationUITest.php, line 74
Contains \Drupal\taxonomy\Tests\TermTranslationUITest.

Class

TermTranslationUITest
Tests the Term Translation UI.

Namespace

Drupal\taxonomy\Tests

Code

protected function getEditValues($values, $langcode, $new = FALSE) {
  $edit = parent::getEditValues($values, $langcode, $new);

  // To be able to post values for the configurable base fields (name,
  // description) have to be suffixed with [0][value].
  foreach ($edit as $property => $value) {
    foreach (array(
      'name',
      'description',
    ) as $key) {
      if ($property == $key) {
        $edit[$key . '[0][value]'] = $value;
        unset($edit[$property]);
      }
    }
  }
  return $edit;
}