Exemplo n.º 1
0
 public function testErrorHandler()
 {
     try {
         Frapi_Error::errorHandler(E_ERROR, 'This is a PHP error', 'ErrorFile.php', '99');
     } catch (Frapi_Error $e) {
         $error = $e->getErrorArray();
     }
     $this->assertEquals(400, $e->getCode());
     $this->assertEquals('Bad Request', $e->getReasonPhrase());
     $this->assertEquals('This is a PHP error (Error Number: 1), (File: ErrorFile.php at line 99)', $error['errors'][0]['message']);
     $this->assertEquals('PHP Fatal error', $error['errors'][0]['name']);
     $this->assertEquals('', $error['errors'][0]['at']);
 }