示例#1
0
 /**
  * @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);
 }
示例#2
0
文件: Module.php 项目: webpants/YAWIK
 public function init(\Zend\ModuleManager\ModuleManagerInterface $moduleManager)
 {
     if (\Zend\Console\Console::isConsole()) {
         return;
     }
     $eventManager = $moduleManager->getEventManager()->getSharedManager();
     $tokenListener = new TokenListener();
     $tokenListener->attachShared($eventManager);
 }