You are here

protected function NodeTranslationUITest::doTestTranslations in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/node/src/Tests/NodeTranslationUITest.php \Drupal\node\Tests\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/src/Tests/NodeTranslationUITest.php
Tests that translations are rendered properly.

File

core/modules/node/src/Tests/NodeTranslationUITest.php, line 366
Contains \Drupal\node\Tests\NodeTranslationUITest.

Class

NodeTranslationUITest
Tests the Node Translation UI.

Namespace

Drupal\node\Tests

Code

protected function doTestTranslations($path, array $values) {
  $languages = $this->container
    ->get('language_manager')
    ->getLanguages();
  foreach ($this->langcodes as $langcode) {
    $this
      ->drupalGet($path, array(
      'language' => $languages[$langcode],
    ));
    $this
      ->assertText($values[$langcode]['title'][0]['value'], format_string('The %langcode node translation is correctly displayed.', array(
      '%langcode' => $langcode,
    )));
  }
}