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