You are here

public function BambooTwigI18nTest::testGetTranslationReferencedField in Bamboo Twig 8.4

Same name and namespace in other branches
  1. 8.5 tests/src/Functional/BambooTwigI18nTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigI18nTest::testGetTranslationReferencedField()

@covers Drupal\bamboo_twig_i18n\TwigExtension\I18n::getTranslation @covers Drupal\bamboo_twig_loader\TwigExtension\Loader::loadEntity

File

tests/src/Functional/BambooTwigI18nTest.php, line 169

Class

BambooTwigI18nTest
Tests I18n twig filters and functions.

Namespace

Drupal\Tests\bamboo_twig\Functional

Code

public function testGetTranslationReferencedField() {
  $this
    ->drupalGet('/bamboo-twig-i18n');
  $this
    ->assertElementContains('.test-i18n div.loader-entity-reference-field-1', 'Mot clé N°4');
  $this
    ->assertElementContains('.test-i18n div.loader-entity-reference-field-2', 'Tag N°2');
  $this
    ->assertElementContains('.test-i18n div.loader-entity-reference-field-3', 'Tag N°3');
  $this
    ->assertElementContains('.test-i18n div.loader-entity-reference-field-4', 'Tag N°1');
  $this
    ->assertElementContains('.test-i18n div.loader-entity-reference-field-5', 'Tag N°5');
  $this
    ->drupalGet('/fr/bamboo-twig-i18n');
  $this
    ->assertElementContains('.test-i18n div.loader-entity-reference-field-1', 'Mot clé N°4');
  $this
    ->assertElementContains('.test-i18n div.loader-entity-reference-field-2', 'Mot clé N°2');
  $this
    ->assertElementContains('.test-i18n div.loader-entity-reference-field-3', 'Mot clé N°3');
  $this
    ->assertElementContains('.test-i18n div.loader-entity-reference-field-4', 'Tag N°1');
  $this
    ->assertElementContains('.test-i18n div.loader-entity-reference-field-5', 'Mot clé N°5');
  $this
    ->drupalGet('/de/bamboo-twig-i18n');
  $this
    ->assertElementContains('.test-i18n div.loader-entity-reference-field-1', 'Mot clé N°4');
  $this
    ->assertElementContains('.test-i18n div.loader-entity-reference-field-2', 'Tag N°2');
  $this
    ->assertElementContains('.test-i18n div.loader-entity-reference-field-3', 'Stichworte N°3');
  $this
    ->assertElementContains('.test-i18n div.loader-entity-reference-field-4', 'Tag N°1');
  $this
    ->assertElementContains('.test-i18n div.loader-entity-reference-field-5', 'Tag N°5');
}