diff --git a/core/modules/taxonomy/src/Tests/TermTranslationFieldViewTest.php b/core/modules/taxonomy/src/Tests/TermTranslationFieldViewTest.php index 9d7a4fc..a4ea628 100644 --- a/core/modules/taxonomy/src/Tests/TermTranslationFieldViewTest.php +++ b/core/modules/taxonomy/src/Tests/TermTranslationFieldViewTest.php @@ -2,7 +2,7 @@ /** * @file - * Definition of Drupal\taxonomy\Tests\TermTranslationUITest. + * Contains \Drupal\taxonomy\Tests\TermTranslationFieldViewTest. */ namespace Drupal\taxonomy\Tests; @@ -10,32 +10,65 @@ use Drupal\language\Entity\ConfigurableLanguage; use Drupal\Core\Field\FieldStorageDefinitionInterface; - /** - * Tests the Term Translation UI. + * Tests the translation of taxonomy terms field on nodes. * * @group taxonomy */ class TermTranslationFieldViewTest extends TaxonomyTestBase { + /** + * The vocabulary. + * + * @var \Drupal\taxonomy\Entity\Vocabulary; + */ protected $vocabulary; /** + * The term that should be translated. + * * @var \Drupal\taxonomy\Entity\Term */ protected $term; + /** + * The field name for our taxonomy term field. + * + * @var string + */ protected $termFieldName = 'field_tag'; + /** + * The langcode of the source language. + * + * @var string + */ protected $baseLangCode = 'en'; + /** + * The langcode to have translations into. + * + * @var string + */ protected $translateToLangCode = 'hu'; + /** + * The tag in the source language. + * + * @var string + */ protected $baseTagName = 'OriginalTagName'; + /** + * The translated value for the tag. + * + * @var string + */ protected $translatedTagName = 'TranslatedTagName'; /** + * The node to check the translated value on. + * * @var \Drupal\node\Entity\Node */ protected $node; @@ -47,8 +80,6 @@ class TermTranslationFieldViewTest extends TaxonomyTestBase { */ public static $modules = array('language', 'content_translation', 'taxonomy'); - /** - */ protected function setUp() { parent::setUp(); $this->setupLanguages(); @@ -59,16 +90,16 @@ protected function setUp() { } /** - * Test if the translated taxonomy term is displayed for the translated entity. + * Tests if the translated taxonomy term is displayed. */ public function testTranslatedTaxonomyTermreferenceDisplay() { $path = 'node/' . $this->node->id(); - $translationPath = $this->translateToLangCode . '/' . $path; + $translation_path = $this->translateToLangCode . '/' . $path; $this->drupalGet($path); $this->assertNoText($this->translatedTagName); $this->assertText($this->baseTagName); - $this->drupalGet($translationPath); + $this->drupalGet($translation_path); $this->assertText($this->translatedTagName); $this->assertNoText($this->baseTagName); } @@ -101,7 +132,6 @@ protected function setUpNode() { $this->node = $node; } - /** * Enables translations where it needed. */ @@ -166,4 +196,5 @@ protected function setUpTermReferenceField() { )) ->save(); } + }