function HelpTopicTranslationTest::testHelpTopicTranslations

Same name and namespace in other branches
  1. 9 core/modules/help_topics/tests/src/Functional/HelpTopicTranslationTest.php \Drupal\Tests\help_topics\Functional\HelpTopicTranslationTest::testHelpTopicTranslations()
  2. 8.9.x core/modules/help_topics/tests/src/Functional/HelpTopicTranslationTest.php \Drupal\Tests\help_topics\Functional\HelpTopicTranslationTest::testHelpTopicTranslations()
  3. 10 core/modules/help/tests/src/Functional/HelpTopicTranslationTest.php \Drupal\Tests\help\Functional\HelpTopicTranslationTest::testHelpTopicTranslations()

Tests help topic translations.

File

core/modules/help/tests/src/Functional/HelpTopicTranslationTest.php, line 38

Class

HelpTopicTranslationTest
Verifies help topic translations.

Namespace

Drupal\Tests\help\Functional

Code

public function testHelpTopicTranslations() : void {
    $session = $this->assertSession();
    // Verify that help topic link is translated on admin/help.
    $this->drupalGet('admin/help');
    $session->linkExists('ABC-Hilfetestmodul');
    // Verify that the language cache tag appears on admin/help.
    $session->responseHeaderContains('X-Drupal-Cache-Contexts', 'languages:language_interface');
    // Verify that help topic is translated.
    $this->drupalGet('admin/help/topic/help_topics_test.test');
    $session->pageTextContains('ABC-Hilfetestmodul');
    $session->pageTextContains('Übersetzung testen.');
    // Verify that the language cache tag appears on a topic page.
    $session->responseHeaderContains('X-Drupal-Cache-Contexts', 'languages:language_interface');
}

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