class HelpTopicTranslationTest
Same name and namespace in other branches
- 11.x core/modules/help/tests/src/Functional/HelpTopicTranslationTest.php \Drupal\Tests\help\Functional\HelpTopicTranslationTest
Verifies help topic translations.
@group help_topics
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\help_topics\Functional\HelpTopicTranslatedTestBase implements \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\help_topics\Functional\HelpTopicTranslationTest implements \Drupal\Tests\help_topics\Functional\HelpTopicTranslatedTestBase
- class \Drupal\Tests\help_topics\Functional\HelpTopicTranslatedTestBase implements \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of HelpTopicTranslationTest
File
-
core/
modules/ help_topics/ tests/ src/ Functional/ HelpTopicTranslationTest.php, line 12
Namespace
Drupal\Tests\help_topics\FunctionalView source
class HelpTopicTranslationTest extends HelpTopicTranslatedTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
// Create user and log in.
$this->drupalLogin($this->createUser([
'access administration pages',
'view the administration theme',
'administer permissions',
]));
}
/**
* Tests help topic translations.
*/
public function testHelpTopicTranslations() {
$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.