/** * @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()); }