function TermTranslationFieldViewTest::testTranslatedTaxonomyTermReferenceDisplay

Same name in other branches
  1. 9 core/modules/taxonomy/tests/src/Functional/TermTranslationFieldViewTest.php \Drupal\Tests\taxonomy\Functional\TermTranslationFieldViewTest::testTranslatedTaxonomyTermReferenceDisplay()
  2. 8.9.x core/modules/taxonomy/tests/src/Functional/TermTranslationFieldViewTest.php \Drupal\Tests\taxonomy\Functional\TermTranslationFieldViewTest::testTranslatedTaxonomyTermReferenceDisplay()
  3. 11.x 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 65

Class

TermTranslationFieldViewTest
Tests the translation of taxonomy terms field on nodes.

Namespace

Drupal\Tests\taxonomy\Functional

Code

public function testTranslatedTaxonomyTermReferenceDisplay() : void {
    $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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.