attach() public method

public attach ( Prooph\Common\Event\ActionEventEmitter $events ) : void
$events Prooph\Common\Event\ActionEventEmitter
return void
コード例 #1
0
 /**
  * @test
  */
 public function it_attaches_to_action_event_emitter()
 {
     $listenerHandler = $this->prophesize(ListenerHandler::class);
     $authorizationService = $this->prophesize(AuthorizationService::class);
     $routeGuard = new FinalizeGuard($authorizationService->reveal());
     $actionEventEmitter = $this->prophesize(ActionEventEmitter::class);
     $actionEventEmitter->attachListener(MessageBus::EVENT_FINALIZE, [$routeGuard, 'onFinalize'], -1000)->willReturn($listenerHandler->reveal());
     $routeGuard->attach($actionEventEmitter->reveal());
 }