Expose the escaping strategy a template was compiled with

This commit is contained in:
Fabien Potencier
2026-09-19 09:12:49 +01:00
parent ea3258396c
commit 26812ebc0d
8 changed files with 201 additions and 0 deletions
+7
View File
@@ -43,6 +43,13 @@ class TemplateWrapperTest extends TestCase
$wrapper->unwrap(new Environment(new ArrayLoader()));
}
public function testGetDefaultEscapeStrategy(): void
{
$twig = new Environment(new ArrayLoader(['index.js.twig' => 'content']), ['autoescape' => 'name']);
$this->assertSame('js', $twig->load('index.js.twig')->getDefaultEscapeStrategy());
}
public function testHasGetBlocks(): void
{
$twig = new Environment(new ArrayLoader([