public function testReceivedPacket() { $connection = $this->getMockBuilder('\\Thruster\\Components\\InterProcessCommunication\\Connection')->getMock(); $packet = new Packet('', Packet::MASTER); $mock = $this->getMockBuilder(__CLASS__)->getMock(); $mock->expects($this->once())->method('testReceivedPacket')->with($packet, $connection); $this->connectionManager->onPacketReceived([$mock, 'testReceivedPacket']); $this->connectionManager->receivedPacket($packet, $connection); }
/** * @return ConnectionManager */ public function getConnectionManager() { if ($this->connectionManager) { return $this->connectionManager; } $this->connectionManager = new ConnectionManager(); $this->connectionManager->setSignalHandler($this->getSignalHandler()); return $this->connectionManager; }