/** * @dataProvider provideRequestParameterTestData * @runInSeparateProcess */ public function testSetsSessionParameterIfTokenParameterIsPassedWhenCalledAsListener($type, $token) { $event = $this->getMvcEventMock($type, array('token' => $token)); $target = new TokenListener(); $target->onBootstrap($event); $session = new \Zend\Session\Container('Auth'); $this->assertEquals($token, $session->token); }
public function init(\Zend\ModuleManager\ModuleManagerInterface $moduleManager) { if (\Zend\Console\Console::isConsole()) { return; } $eventManager = $moduleManager->getEventManager()->getSharedManager(); $tokenListener = new TokenListener(); $tokenListener->attachShared($eventManager); }