fix TwigExtraBundle tests with Symfony 6.0/6.1

This commit is contained in:
Christian Flothmann
2024-02-07 08:31:24 +01:00
parent 7e1945a618
commit d9d7e136c1
@@ -5,6 +5,7 @@ namespace Twig\Extra\TwigExtraBundle\Tests\Fixture;
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 @@ class Kernel extends BaseKernel
'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',