示例#1
0
 /**
  * {@inheritdoc}
  */
 public static function errorHandler($errno, $errstr, $errfile = '', $errline = 0, $errcontext = array())
 {
     parent::errorHandler($errno, $errstr, $errfile, $errline, $errcontext);
     if (Kohana::$errors === true) {
         Kohana::error_handler($errno, $errstr, $errfile, $errline);
     }
 }
示例#2
0
 /**
  * Tests Kohana::error_handler()
  *
  * @test
  * @dataProvider provider_error_handler
  * @covers Kohana::error_handler
  * @param boolean $code  Input for Kohana::sanitize
  * @param boolean $error  Input for Kohana::sanitize
  * @param boolean $file  Input for Kohana::sanitize
  * @param boolean $line Output for Kohana::sanitize
  */
 public function test_error_handler($code, $error, $file, $line)
 {
     $error_level = error_reporting();
     error_reporting(E_ALL);
     try {
         Kohana::error_handler($code, $error, $file, $line);
     } catch (Exception $e) {
         $this->assertEquals($code, $e->getCode());
         $this->assertEquals($error, $e->getMessage());
     }
     error_reporting($error_level);
 }