Example #1
0
 public function test_enable_exception_handling()
 {
     $handler = new ErrorHandler();
     $this->assertFalse($handler->isExceptionHandlingEnabled());
     $handler->enableExceptionHandling();
     $this->assertTrue($handler->isExceptionHandlingEnabled());
     $handler->enableExceptionHandling();
     $this->assertTrue($handler->isExceptionHandlingEnabled());
 }
<?php

use Weew\ErrorHandler\ErrorHandler;
use Weew\ErrorHandler\ErrorType;
require __DIR__ . '/../../../../vendor/autoload.php';
$errorHandler = new ErrorHandler(true);
$errorHandler->enableRecoverableErrorHandling();
$errorHandler->enableExceptionHandling();
trigger_error('error', ErrorType::USER_ERROR);
echo 'continue';