/**
  * Test dispatcher method.
  */
 public function testDispatcher()
 {
     $this->given($dispatcher = new EventDispatcher())->and($middleware = new EventDispatcherMiddleware($dispatcher))->when($result = $middleware->dispatcher())->then()->object($result)->isEqualTo($dispatcher);
 }
예제 #2
0
 /**
  * Checks whether has any registered listener.
  *
  * @return bool
  */
 public function hasListeners()
 {
     $this->ensureEventDispatcherMiddleware();
     return $this->dispatcherMiddleware->dispatcher()->hasListeners();
 }