Author: nadar
Inheritance: extends yii\console\ErrorHandler, use trait luya\traits\ErrorHandlerTrait
Example #1
0
 public function testExceptionArrayTrace()
 {
     try {
         $stud = new ErrorHandler();
         $response = $stud->getExceptionArray(['array', 'is', 'exception']);
         $this->assertArrayHasKey('message', $response);
         $this->assertArrayHasKey('file', $response);
         $this->assertArrayHasKey('line', $response);
         $this->assertArrayHasKey('requestUri', $response);
         $this->assertArrayHasKey('serverName', $response);
         $this->assertArrayHasKey('date', $response);
         $this->assertArrayHasKey('trace', $response);
         $this->assertArrayHasKey('ip', $response);
         $this->assertArrayHasKey('get', $response);
         $this->assertArrayHasKey('post', $response);
         $this->assertTrue(is_Array($response['trace']));
     } catch (Exception $e) {
         $this->assertEquals('Error: foobar', $e->getMessage());
     }
 }