You are here

public function HierarchicalTaxonomyMenuTranslationTest::testTranslatedBlockContent in Hierarchical Taxonomy Menu 8

Test translated block content.

File

tests/src/Functional/HierarchicalTaxonomyMenuTranslationTest.php, line 101

Class

HierarchicalTaxonomyMenuTranslationTest
Tests the Hierarchical Taxonomy Menu block with translated taxonomy terms.

Namespace

Drupal\Tests\hierarchical_taxonomy_menu\Functional

Code

public function testTranslatedBlockContent() {
  $this
    ->drupalGet('taxonomy/term/1');
  $block_element = $this
    ->getSession()
    ->getPage()
    ->find('css', '.block-taxonomymenu__menu');
  $this
    ->assertStringContainsString('Parent', $block_element
    ->getText());
  $this
    ->assertStringContainsString('Child', $block_element
    ->getText());
  $this
    ->drupalGet('sr/taxonomy/term/1');
  $block_element = $this
    ->getSession()
    ->getPage()
    ->find('css', '.block-taxonomymenu__menu');
  $this
    ->assertStringContainsString('Roditelj', $block_element
    ->getText());
  $this
    ->assertStringContainsString('Dete', $block_element
    ->getText());
}