You are here

protected function NodeTranslationUITest::doTestTranslations in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/node/tests/src/Functional/NodeTranslationUITest.php \Drupal\Tests\node\Functional\NodeTranslationUITest::doTestTranslations()

Tests that the given path displays the correct translation values.

Parameters

string $path: The path to be tested.

array $values: The translation values to be found.

1 call to NodeTranslationUITest::doTestTranslations()
NodeTranslationUITest::testTranslationRendering in core/modules/node/tests/src/Functional/NodeTranslationUITest.php
Tests that translations are rendered properly.

File

core/modules/node/tests/src/Functional/NodeTranslationUITest.php, line 402

Class

NodeTranslationUITest
Tests the Node Translation UI.

Namespace

Drupal\Tests\node\Functional

Code

protected function doTestTranslations($path, array $values) {
  $languages = $this->container
    ->get('language_manager')
    ->getLanguages();
  foreach ($this->langcodes as $langcode) {
    $this
      ->drupalGet($path, [
      'language' => $languages[$langcode],
    ]);
    $this
      ->assertSession()
      ->pageTextContains($values[$langcode]['title'][0]['value']);
  }
}