File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 2323use Symfony \Component \Routing \Generator \UrlGeneratorInterface ;
2424use Twig \Environment ;
2525use Twig \Loader \FilesystemLoader ;
26- use Twig \RuntimeLoader \RuntimeLoaderInterface ;
26+ use Twig \Runtime \EscaperRuntime ;
27+ use Twig \RuntimeLoader \FactoryRuntimeLoader ;
2728
2829use function class_exists ;
2930use function html_entity_decode ;
@@ -79,9 +80,10 @@ public function setUp(): void
7980 $ this ->twig ->addExtension (new WebProfilerExtension ());
8081 $ this ->twig ->addExtension (new DoctrineExtension ());
8182
82- $ loader = $ this ->getMockBuilder (RuntimeLoaderInterface::class)->getMock ();
83- $ loader ->method ('load ' )->willReturn ($ kernelRuntime );
84- $ this ->twig ->addRuntimeLoader ($ loader );
83+ $ this ->twig ->addRuntimeLoader (new FactoryRuntimeLoader ([
84+ HttpKernelRuntime::class => static fn () => $ kernelRuntime ,
85+ EscaperRuntime::class => static fn () => new EscaperRuntime (),
86+ ]));
8587 }
8688
8789 public function testRender (): void
You can’t perform that action at this time.
0 commit comments