ErrorHandlerConfigurator example

use PHPUnit\Framework\TestCase;
use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel;
use Symfony\Component\ErrorHandler\ErrorHandler;
use Symfony\Component\HttpKernel\Debug\ErrorHandlerConfigurator;

class ErrorHandlerConfiguratorTest extends TestCase
{
    public function testConfigure()
    {
        $logger = $this->createMock(LoggerInterface::class);
        $configurator = new ErrorHandlerConfigurator($logger);
        $handler = new ErrorHandler();

        $configurator->configure($handler);

        $loggers = $handler->setLoggers([]);

        $this->assertArrayHasKey(\E_DEPRECATED, $loggers);
        $this->assertSame([$logger, LogLevel::INFO]$loggers[\E_DEPRECATED]);
    }

    /** * @dataProvider provideLevelsAssignedToLoggers */
Home | Imprint | This part of the site doesn't use cookies.