Install a custom exception handler before bootstrapping KernelTestCase

This commit is contained in:
Fabien Potencier
2026-05-24 10:25:53 +02:00
parent 85013f01b3
commit 54420847f0
2 changed files with 18 additions and 1 deletions
@@ -0,0 +1,17 @@
<?php
/*
* This file is part of Twig.
*
* (c) Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Symfony\Component\ErrorHandler\ErrorHandler;
require __DIR__.'/vendor/autoload.php';
// see https://github.com/symfony/symfony/issues/53812#issuecomment-1962740145
set_exception_handler([new ErrorHandler(), 'handleException']);
+1 -1
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="vendor/autoload.php" failOnRisky="true" failOnWarning="true">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="phpunit-bootstrap.php" failOnRisky="true" failOnWarning="true">
<coverage>
<include>
<directory>./</directory>