Пример #1
0
 function testRemoveScriber()
 {
     $this->dispatcher->removeAll();
     CallbackListener::clearListeners();
     $subscriber = new Subscriber();
     $this->dispatcher->addSubscriber($subscriber);
     $this->assertCount(1, $this->dispatcher->getListeners(self::EVENT_FOOL1));
     $this->assertCount(1, $this->dispatcher->getListeners(self::EVENT_FOOL2));
     $this->dispatcher->removeSubscriber($subscriber);
     $this->assertCount(0, $this->dispatcher->getListeners(self::EVENT_FOOL1));
     $this->assertCount(0, $this->dispatcher->getListeners(self::EVENT_FOOL2));
 }