luyatests\core\traits\ErrorHandlerTest::testExceptionStringTrace PHP Method

testExceptionStringTrace() public method

    public function testExceptionStringTrace()
    {
        try {
            $stud = new ErrorHandler();
            $response = $stud->getExceptionArray('Is a string 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());
        }
    }