diff -u b/core/modules/taxonomy/tests/src/Functional/TermLanguageTest.php b/core/modules/taxonomy/tests/src/Functional/TermLanguageTest.php --- b/core/modules/taxonomy/tests/src/Functional/TermLanguageTest.php +++ b/core/modules/taxonomy/tests/src/Functional/TermLanguageTest.php @@ -107,29 +107,32 @@ $this->assertOptionSelected('edit-langcode-0-value', 'cc', "The expected langcode, 'cc', was selected."); } - function testTermTranslatedOnOverviewPage() { + /** + * Tests that translated terms are displayed correctly on the term overview. + */ + public function testTermTranslatedOnOverviewPage() { // Configure the vocabulary to not hide the language selector. - $edit = array( + $edit = [ 'default_language[language_alterable]' => TRUE, - ); + ]; $this->drupalPostForm('admin/structure/taxonomy/manage/' . $this->vocabulary->id(), $edit, t('Save')); // Add a term. $this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add'); // Submit the term. - $edit = array( + $edit = [ 'name[0][value]' => $this->randomMachineName(), 'langcode[0][value]' => 'aa', - ); + ]; $this->drupalPostForm(NULL, $edit, t('Save')); $terms = taxonomy_term_load_multiple_by_name($edit['name[0][value]']); $term = reset($terms); // Add a translation for that term. $translated_title = $this->randomMachineName(); - $term->addTranslation('bb', array( + $term->addTranslation('bb', [ 'name' => $translated_title, - )); + ]); $term->save(); // Overview page in the other language shows the translated term