Kraken\_Unit\Network\Http\Component\Router\HttpRouterTest::testApiHandleError_ClosesConnectionWithCode500_WhenConnectionControllerDoesExistButThrowsException PHP Method

testApiHandleError_ClosesConnectionWithCode500_WhenConnectionControllerDoesExistButThrowsException() public method

    public function testApiHandleError_ClosesConnectionWithCode500_WhenConnectionControllerDoesExistButThrowsException()
    {
        $ex = new Exception();
        $conn = $this->getMock(NetworkConnection::class, [], [], '', false);
        $conn->controller = $this->createComponent();
        $conn->controller->expects($this->once())->method('handleError')->will($this->throwException(new Exception()));
        $server = $this->createServer();
        $router = $this->createRouter($server, ['close']);
        $router->expects($this->once())->method('close')->with($conn, 500);
        $router->handleError($conn, $ex);
    }
HttpRouterTest