diff --git a/src/Listener/LocatorRegistrationListener.php b/src/Listener/LocatorRegistrationListener.php index def065c..6c04df3 100644 --- a/src/Listener/LocatorRegistrationListener.php +++ b/src/Listener/LocatorRegistrationListener.php @@ -15,6 +15,7 @@ use Zend\EventManager\ListenerAggregateInterface; use Zend\ModuleManager\Feature\LocatorRegisteredInterface; use Zend\ModuleManager\ModuleEvent; +use Zend\Mvc\MvcEvent; /** * Locator registration listener @@ -67,7 +68,7 @@ public function onLoadModulesPost(Event $e) $events = $moduleManager->getEventManager()->getSharedManager(); // Shared instance for module manager - $events->attach('Zend\Mvc\Application', 'bootstrap', function ($e) use ($moduleManager) { + $events->attach('Zend\Mvc\Application', MvcEvent::EVENT_BOOTSTRAP, function ($e) use ($moduleManager) { $moduleClassName = get_class($moduleManager); $application = $e->getApplication(); $services = $application->getServiceManager(); @@ -81,7 +82,7 @@ public function onLoadModulesPost(Event $e) } // Attach to the bootstrap event if there are modules we need to process - $events->attach('Zend\Mvc\Application', 'bootstrap', array($this, 'onBootstrap'), 1000); + $events->attach('Zend\Mvc\Application', MvcEvent::EVENT_BOOTSTRAP, array($this, 'onBootstrap'), 1000); } /** diff --git a/src/Listener/OnBootstrapListener.php b/src/Listener/OnBootstrapListener.php index 4e96b33..8640cf3 100644 --- a/src/Listener/OnBootstrapListener.php +++ b/src/Listener/OnBootstrapListener.php @@ -12,6 +12,7 @@ use Zend\ModuleManager\Feature\BootstrapListenerInterface; use Zend\ModuleManager\ModuleEvent; +use Zend\Mvc\MvcEvent; /** * Autoloader listener @@ -39,6 +40,6 @@ public function __invoke(ModuleEvent $e) $moduleManager = $e->getTarget(); $events = $moduleManager->getEventManager(); $sharedEvents = $events->getSharedManager(); - $sharedEvents->attach('Zend\Mvc\Application', 'bootstrap', array($module, 'onBootstrap')); + $sharedEvents->attach('Zend\Mvc\Application', MvcEvent::EVENT_BOOTSTRAP, array($module, 'onBootstrap')); } } diff --git a/test/TestAsset/MockApplication.php b/test/TestAsset/MockApplication.php index 3f6ebc5..14da1ac 100644 --- a/test/TestAsset/MockApplication.php +++ b/test/TestAsset/MockApplication.php @@ -82,6 +82,6 @@ public function bootstrap() $event = new MvcEvent(); $event->setApplication($this); $event->setTarget($this); - $this->getEventManager()->trigger('bootstrap', $event); + $this->getEventManager()->trigger(MvcEvent::EVENT_BOOTSTRAP, $event); } }