示例#1
0
 public function testInvalidListenerObject()
 {
     $this->setExpectedException('\\InvalidArgumentException');
     $this->object->addListener(function ($event) {
         return false;
     });
 }
示例#2
0
 /**
  */
 public function testRemoveListener()
 {
     $eventName = 'test';
     $dispatcher = new Dispatcher();
     $listener = new Listener($eventName);
     $dispatcher->addListener($eventName, $listener);
     $dispatcher->removeListener($eventName, $listener);
     $this->assertEmpty($dispatcher->getListeners());
 }