File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 23
23
use Symfony \Component \Routing \Generator \UrlGeneratorInterface ;
24
24
use Twig \Environment ;
25
25
use Twig \Loader \FilesystemLoader ;
26
+ use Twig \Runtime \EscaperRuntime ;
27
+ use Twig \RuntimeLoader \FactoryRuntimeLoader ;
26
28
use Twig \RuntimeLoader \RuntimeLoaderInterface ;
27
29
28
30
use function class_exists ;
@@ -81,7 +83,10 @@ public function setUp(): void
81
83
82
84
$ loader = $ this ->getMockBuilder (RuntimeLoaderInterface::class)->getMock ();
83
85
$ loader ->method ('load ' )->willReturn ($ kernelRuntime );
84
- $ this ->twig ->addRuntimeLoader ($ loader );
86
+ $ this ->twig ->addRuntimeLoader (new FactoryRuntimeLoader ([
87
+ HttpKernelRuntime::class => static fn () => $ kernelRuntime ,
88
+ EscaperRuntime::class => static fn () => new EscaperRuntime (),
89
+ ]));
85
90
}
86
91
87
92
public function testRender (): void
You can’t perform that action at this time.
0 commit comments