From 85cbe2067530d4d0d9ac08d73d26e10fcee17e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Ostroluck=C3=BD?= Date: Sun, 5 May 2024 10:34:25 +0200 Subject: [PATCH] Fix ProfilerTest --- tests/ProfilerTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/ProfilerTest.php b/tests/ProfilerTest.php index 4f1c1459..94dabbac 100644 --- a/tests/ProfilerTest.php +++ b/tests/ProfilerTest.php @@ -23,6 +23,8 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Twig\Environment; use Twig\Loader\FilesystemLoader; +use Twig\Runtime\EscaperRuntime; +use Twig\RuntimeLoader\FactoryRuntimeLoader; use Twig\RuntimeLoader\RuntimeLoaderInterface; use function class_exists; @@ -81,7 +83,10 @@ public function setUp(): void $loader = $this->getMockBuilder(RuntimeLoaderInterface::class)->getMock(); $loader->method('load')->willReturn($kernelRuntime); - $this->twig->addRuntimeLoader($loader); + $this->twig->addRuntimeLoader(new FactoryRuntimeLoader([ + HttpKernelRuntime::class => fn() => $kernelRuntime, + EscaperRuntime::class => fn() => new EscaperRuntime(), + ])); } public function testRender(): void