diff --git a/Tests/Fixture/Kernel.php b/Tests/Fixture/Kernel.php index 857ed95..faad85c 100644 --- a/Tests/Fixture/Kernel.php +++ b/Tests/Fixture/Kernel.php @@ -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; @@ -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',