You are here

public function TermTranslationFieldViewTest::testTranslatedTaxonomyTermReferenceDisplay in Drupal 9

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

Tests if the translated taxonomy term is displayed.

File

core/modules/taxonomy/tests/src/Functional/TermTranslationFieldViewTest.php, line 62

Class

TermTranslationFieldViewTest
Tests the translation of taxonomy terms field on nodes.

Namespace

Drupal\Tests\taxonomy\Functional

Code

public function testTranslatedTaxonomyTermReferenceDisplay() {
  $path = 'node/' . $this->node
    ->id();
  $translation_path = $this->translateToLangcode . '/' . $path;
  $this
    ->drupalGet($path);
  $this
    ->assertSession()
    ->pageTextNotContains($this->translatedTagName);
  $this
    ->assertSession()
    ->pageTextContains($this->baseTagName);
  $this
    ->drupalGet($translation_path);
  $this
    ->assertSession()
    ->pageTextContains($this->translatedTagName);
  $this
    ->assertSession()
    ->pageTextNotContains($this->baseTagName);
}