Kraken\_Unit\Network\Socket\WsServerTest::testApiHandleDisconnect_CallsMethodOnComponent_WhenConnectionDoesExist PHP Метод

testApiHandleDisconnect_CallsMethodOnComponent_WhenConnectionDoesExist() публичный Метод

    public function testApiHandleDisconnect_CallsMethodOnComponent_WhenConnectionDoesExist()
    {
        $conn = $this->getMock(NetworkConnectionInterface::class, [], [], '', false);
        $upgraded = $this->getMock(NetworkConnectionInterface::class, [], [], '', false);
        $aware = $this->createAware();
        $component = $this->createComponent();
        $component->expects($this->once())->method('handleDisconnect')->with($upgraded);
        $server = $this->createServer($aware, $component);
        $storage = $this->getProtectedProperty($server, 'connCollection');
        $storage->attach($conn, $upgraded);
        $server->handleDisconnect($conn);
    }