public function testLoopWillEndWhenServerIsShutDownAfterSingleConnection()
{
$client = stream_socket_client('tcp://localhost:' . $this->port);
// explicitly unset server because we only accept a single connection
// and then already call shutdown()
$server = $this->server;
$this->server = null;
$server->on('connection', function ($conn) use($server) {
$conn->close();
$server->shutdown();
});
$this->loop->run();
}