Skip to content

Commit 6fc5af1

Browse files
committed
Fix ProfilerTest
1 parent 8925ffa commit 6fc5af1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: tests/ProfilerTest.php

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

2830
use function class_exists;
@@ -81,7 +83,10 @@ public function setUp(): void
8183

8284
$loader = $this->getMockBuilder(RuntimeLoaderInterface::class)->getMock();
8385
$loader->method('load')->willReturn($kernelRuntime);
84-
$this->twig->addRuntimeLoader($loader);
86+
$this->twig->addRuntimeLoader(new FactoryRuntimeLoader([
87+
HttpKernelRuntime::class => static fn () => $kernelRuntime,
88+
EscaperRuntime::class => static fn () => new EscaperRuntime(),
89+
]));
8590
}
8691

8792
public function testRender(): void

0 commit comments

Comments
 (0)