Skip to content

Commit

Permalink
Fix ProfilerTest
Browse files Browse the repository at this point in the history
  • Loading branch information
ostrolucky committed May 5, 2024
1 parent 8925ffa commit 9910dc5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/ProfilerTest.php
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9910dc5

Please sign in to comment.