function TwigSettingsTest::testTwigInlineWithAutoReload

Same name in other branches
  1. 8.9.x 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()
  3. 11.x 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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.