public function testApiHandleConnect_SetsConnectionFlags()
{
$aware = $this->createAware();
$component = $this->createComponent();
$server = $this->createServer($aware, $component, ['attemptUpgrade']);
$server->expects($this->once())->method('attemptUpgrade');
$req = $this->getMock(HttpRequest::class, [], [], '', false);
$conn = $this->getMock(NetworkConnectionInterface::class, [], [], '', false);
$conn->httpRequest = $req;
$server->handleConnect($conn);
$this->assertInstanceOf(StdClass::class, $conn->WebSocket);
$this->assertSame($req, $conn->WebSocket->request);
$this->assertSame(false, $conn->WebSocket->established);
$this->assertSame(false, $conn->WebSocket->closing);
}