DebugHandlersListener example

use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\KernelEvents;

/** * @author Nicolas Grekas <p@tchwork.com> */
class DebugHandlersListenerTest extends TestCase
{
    public function testConfigure()
    {
        $userHandler = static fn () => null;
        $listener = new DebugHandlersListener($userHandler);
        $eHandler = new ErrorHandler();

        $exception = null;
        set_error_handler([$eHandler, 'handleError']);
        set_exception_handler([$eHandler, 'handleException']);
        try {
            $listener->configure();
        } catch (\Exception $exception) {
        } finally {
            restore_exception_handler();
            restore_error_handler();
        }
Home | Imprint | This part of the site doesn't use cookies.