You are here

protected function TermTranslationUITest::getEditValues in Drupal 9

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

Returns an edit array containing the values to be posted.

Overrides ContentTranslationUITestBase::getEditValues

File

core/modules/taxonomy/tests/src/Functional/TermTranslationUITest.php, line 86

Class

TermTranslationUITest
Tests the Term Translation UI.

Namespace

Drupal\Tests\taxonomy\Functional

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 ([
      'name',
      'description',
    ] as $key) {
      if ($property == $key) {
        $edit[$key . '[0][value]'] = $value;
        unset($edit[$property]);
      }
    }
  }
  return $edit;
}