public function testApiHandleError_ClosesConnection_WhenConnectionIsNotRegisteredButIsEstablished()
{
$ex = new Exception();
$conn = $this->getMock(NetworkConnectionInterface::class, [], [], '', false);
$conn->expects($this->once())->method('close');
$conn->WebSocket = new StdClass();
$conn->WebSocket->established = true;
$aware = $this->createAware();
$component = $this->createComponent();
$component->expects($this->never())->method('handleError');
$server = $this->createServer($aware, $component);
$server->handleError($conn, $ex);
}