From 9910dc51b9a685c2bc7bce644a771cf64ff7e765 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 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/ProfilerTest.php b/tests/ProfilerTest.php index 4f1c1459..787a538d 100644 --- a/tests/ProfilerTest.php +++ b/tests/ProfilerTest.php @@ -23,7 +23,8 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Twig\Environment; use Twig\Loader\FilesystemLoader; -use Twig\RuntimeLoader\RuntimeLoaderInterface; +use Twig\Runtime\EscaperRuntime; +use Twig\RuntimeLoader\FactoryRuntimeLoader; use function class_exists; use function html_entity_decode; @@ -79,9 +80,10 @@ public function setUp(): void $this->twig->addExtension(new WebProfilerExtension()); $this->twig->addExtension(new DoctrineExtension()); - $loader = $this->getMockBuilder(RuntimeLoaderInterface::class)->getMock(); - $loader->method('load')->willReturn($kernelRuntime); - $this->twig->addRuntimeLoader($loader); + $this->twig->addRuntimeLoader(new FactoryRuntimeLoader([ + HttpKernelRuntime::class => static fn () => $kernelRuntime, + EscaperRuntime::class => static fn () => new EscaperRuntime(), + ])); } public function testRender(): void