File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
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 \RuntimeLoader \RuntimeLoaderInterface ;
26
+ use Twig \Runtime \EscaperRuntime ;
27
+ use Twig \RuntimeLoader \FactoryRuntimeLoader ;
27
28
28
29
use function class_exists ;
29
30
use function html_entity_decode ;
@@ -79,9 +80,10 @@ public function setUp(): void
79
80
$ this ->twig ->addExtension (new WebProfilerExtension ());
80
81
$ this ->twig ->addExtension (new DoctrineExtension ());
81
82
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
+ ]));
85
87
}
86
88
87
89
public function testRender (): void
You can’t perform that action at this time.
0 commit comments