Skip to content

Commit 9910dc5

Browse files
committed
Fix ProfilerTest
1 parent 8925ffa commit 9910dc5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/ProfilerTest.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
2424
use Twig\Environment;
2525
use Twig\Loader\FilesystemLoader;
26-
use Twig\RuntimeLoader\RuntimeLoaderInterface;
26+
use Twig\Runtime\EscaperRuntime;
27+
use Twig\RuntimeLoader\FactoryRuntimeLoader;
2728

2829
use function class_exists;
2930
use 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

0 commit comments

Comments
 (0)