예제 #1
0
파일: AppTest.php 프로젝트: fobiaweb/slim
 /**
  * Test custom global error handler
  */
 public function testHandleErrors()
 {
     $defaultErrorReporting = error_reporting();
     // Test 1
     error_reporting(E_ALL ^ E_NOTICE);
     // <-- Report all errors EXCEPT notices
     try {
         \Slim\App::handleErrors(E_NOTICE, 'test error', 'Slim.php', 119);
     } catch (\ErrorException $e) {
         $this->fail('Slim::handleErrors reported a disabled error level.');
     }
     // Test 2
     error_reporting(E_ALL | E_STRICT);
     // <-- Report all errors, including E_STRICT
     try {
         \Slim\App::handleErrors(E_STRICT, 'test error', 'Slim.php', 119);
         $this->fail('Slim::handleErrors didn\'t report a enabled error level');
     } catch (\ErrorException $e) {
     }
     error_reporting($defaultErrorReporting);
 }