public function TwigEnvironmentTest::testTwigEmbed in Drupal 9
Same name and namespace in other branches
- 8 core/modules/system/tests/src/Functional/Theme/TwigEnvironmentTest.php \Drupal\Tests\system\Functional\Theme\TwigEnvironmentTest::testTwigEmbed()
- 10 core/modules/system/tests/src/Functional/Theme/TwigEnvironmentTest.php \Drupal\Tests\system\Functional\Theme\TwigEnvironmentTest::testTwigEmbed()
Tests template class loading with Twig embed.
File
- core/
modules/ system/ tests/ src/ Functional/ Theme/ TwigEnvironmentTest.php, line 27
Class
- TwigEnvironmentTest
- Tests Twig environment.
Namespace
Drupal\Tests\system\Functional\ThemeCode
public function testTwigEmbed() {
$assert_session = $this
->assertSession();
// Test the Twig embed tag.
$this
->drupalGet('twig-theme-test/embed-tag');
$assert_session
->statusCodeEquals(200);
$assert_session
->responseContains('This line is from twig_theme_test/templates/twig-theme-test-embed-tag-embedded.html.twig');
}