getListeners() public static method

Get all of the listeners for a given event name.
public static getListeners ( string $eventName ) : array
$eventName string
return array
Ejemplo n.º 1
0
 public function testDetach()
 {
     $event = new Event('test');
     $listener = $this->getMock('\\SplObserver');
     $event->attach($listener);
     $event->detach($listener);
     $this->assertCount(0, $event->getListeners());
 }
Ejemplo n.º 2
0
 public function testShouldReturnListenerCollection()
 {
     $event = new Event('whatever');
     $this->assertInstanceOf('PHPFluent\\EventManager\\Listener\\Collection', $event->getListeners());
 }