Skip to content

Commit

Permalink
fix move of CodeExtension
Browse files Browse the repository at this point in the history
  • Loading branch information
chr-hertel committed Nov 10, 2023
1 parent f549108 commit a548ed9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Tests/ProfilerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Symfony\Bridge\Twig\Extension\HttpKernelExtension;
use Symfony\Bridge\Twig\Extension\HttpKernelRuntime;
use Symfony\Bridge\Twig\Extension\RoutingExtension;
use Symfony\Bundle\WebProfilerBundle\Profiler\CodeExtension as CodeExtensionV7;
use Symfony\Bundle\WebProfilerBundle\Twig\WebProfilerExtension;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
Expand All @@ -24,6 +25,7 @@
use Twig\Loader\FilesystemLoader;
use Twig\RuntimeLoader\RuntimeLoaderInterface;

use function class_exists;
use function html_entity_decode;
use function preg_match;
use function preg_quote;
Expand Down Expand Up @@ -62,7 +64,12 @@ public function setUp(): void
$urlGenerator = $this->getMockBuilder(UrlGeneratorInterface::class)->getMock();
$urlGenerator->method('generate')->willReturn('');

$this->twig->addExtension(new CodeExtension('', '', ''));
if (class_exists(CodeExtensionV7::class)) {
$this->twig->addExtension(new CodeExtensionV7('', '', ''));
} else {
$this->twig->addExtension(new CodeExtension('', '', ''));
}

$this->twig->addExtension(new RoutingExtension($urlGenerator));
$this->twig->addExtension(new HttpKernelExtension());
/**
Expand Down

0 comments on commit a548ed9

Please sign in to comment.