You are here

public function TwigSettingsTest::testTwigInlineWithAutoReload in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Functional/Theme/TwigSettingsTest.php \Drupal\Tests\system\Functional\Theme\TwigSettingsTest::testTwigInlineWithAutoReload()
  2. 10 core/modules/system/tests/src/Functional/Theme/TwigSettingsTest.php \Drupal\Tests\system\Functional\Theme\TwigSettingsTest::testTwigInlineWithAutoReload()

Tests twig inline templates with auto_reload.

File

core/modules/system/tests/src/Functional/Theme/TwigSettingsTest.php, line 127

Class

TwigSettingsTest
Tests overriding Twig engine settings via settings.php.

Namespace

Drupal\Tests\system\Functional\Theme

Code

public function testTwigInlineWithAutoReload() {
  $parameters = $this->container
    ->getParameter('twig.config');
  $parameters['auto_reload'] = TRUE;
  $parameters['debug'] = TRUE;
  $this
    ->setContainerParameter('twig.config', $parameters);
  $this
    ->rebuildContainer();
  $this
    ->drupalGet('theme-test/inline-template-test');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->drupalGet('theme-test/inline-template-test');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
}