Ejemplo n.º 1
0
 /**
  * @return PacketHandler
  */
 public function getPacketHandler()
 {
     if ($this->packetHandler) {
         return $this->packetHandler;
     }
     $this->packetHandler = new PacketHandler();
     $this->packetHandler->addProvider($this->getConnectionManager());
     return $this->packetHandler;
 }
Ejemplo n.º 2
0
 public function testAddAndRemoveSubscribers()
 {
     $subscriber = $this->getSubscriber();
     $this->packetHandler->addSubscriber($subscriber);
     $this->assertEquals(['foo' => [0 => [[$subscriber, 'foo']]], 'rab' => [0 => [[$subscriber, 'rab']]], 'bar' => [0 => [[$subscriber, 'bar']], 10 => [[$subscriber, 'rab']]]], $this->packetHandler->getHandlers(null, true));
     $this->assertTrue($this->packetHandler->hasHandlers());
     $this->packetHandler->removeSubscriber($subscriber);
     $this->assertFalse($this->packetHandler->hasHandlers());
 }