public function testApiHandleMessage_ClosesConnectionWithCode500_WhenHttpRequestReceived_ButMatcherThrowsException()
{
$conn = $this->getMock(NetworkConnection::class, [], [], '', false);
$mssg = $this->createPassableMessage();
$server = $this->createServer();
$router = $this->createRouter($server, ['close']);
$router->expects($this->once())->method('close')->with($conn, 500);
$matcher = $this->createMatcher(['match']);
$matcher->expects($this->once())->method('match')->will($this->throwException(new Exception()));
$router->handleMessage($conn, $mssg);
}