You are here

public function TwigEnvironmentTest::testTwigEmbed in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Functional/Theme/TwigEnvironmentTest.php \Drupal\Tests\system\Functional\Theme\TwigEnvironmentTest::testTwigEmbed()
  2. 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\Theme

Code

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');
}