Skip to content

Commit

Permalink
fix TwigExtraBundle tests with Symfony 6.0/6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Feb 7, 2024
1 parent d131e6d commit 3a68ffc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Tests/Fixture/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use League\CommonMark\Extension\Strikethrough\StrikethroughExtension;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Bundle\FrameworkBundle\Test\NotificationAssertionsTrait;
use Symfony\Bundle\TwigBundle\TwigBundle;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand All @@ -29,11 +30,16 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load
'test' => true,
'router' => ['utf8' => true],
'http_method_override' => false,
'php_errors' => [
'log' => true,
],
];
if (6 === Kernel::MAJOR_VERSION) {

// the "handle_all_throwables" option was introduced in FrameworkBundle 6.2 (and so was the NotificationAssertionsTrait)
if (trait_exists(NotificationAssertionsTrait::class)) {
$config['handle_all_throwables'] = true;
$config['php_errors']['log'] = true;
}

$c->loadFromExtension('framework', $config);
$c->loadFromExtension('twig', [
'default_path' => __DIR__.'/views',
Expand Down

0 comments on commit 3a68ffc

Please sign in to comment.