function TwigTransTest::testTwigTransTags
Same name in other branches
- 9 core/modules/system/tests/src/Functional/Theme/TwigTransTest.php \Drupal\Tests\system\Functional\Theme\TwigTransTest::testTwigTransTags()
- 8.9.x core/modules/system/tests/src/Functional/Theme/TwigTransTest.php \Drupal\Tests\system\Functional\Theme\TwigTransTest::testTwigTransTags()
- 10 core/modules/system/tests/src/Functional/Theme/TwigTransTest.php \Drupal\Tests\system\Functional\Theme\TwigTransTest::testTwigTransTags()
Tests Twig "trans" tags.
File
-
core/
modules/ system/ tests/ src/ Functional/ Theme/ TwigTransTest.php, line 86
Class
- TwigTransTest
- Tests Twig "trans" tags.
Namespace
Drupal\Tests\system\Functional\ThemeCode
public function testTwigTransTags() : void {
// Run this once without and once with Twig debug because trans can work
// differently depending on that setting.
$this->drupalGet('twig-theme-test/trans', [
'language' => \Drupal::languageManager()->getLanguage('xx'),
]);
$this->assertTwigTransTags();
// Enable debug, rebuild the service container, and clear all caches.
$parameters = $this->container
->getParameter('twig.config');
$parameters['debug'] = TRUE;
$this->setContainerParameter('twig.config', $parameters);
$this->rebuildContainer();
$this->resetAll();
$this->drupalGet('twig-theme-test/trans', [
'language' => \Drupal::languageManager()->getLanguage('xx'),
]);
$this->assertTwigTransTags();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.