public function setUp()
 {
     parent::setUp();
     $this->listener = new WriteTokenToCookie();
     $this->listener->setRequest($this->request = new Request());
     $this->listener->setResponse($this->response = new Response());
     $this->rememberMeService = $this->getMock('JwPersistentUser\\Service\\RememberMeService');
     $this->listener->setRememberMeService($this->rememberMeService);
     $this->cookieService = $this->getMock('JwPersistentUser\\Service\\CookieService');
     $this->listener->setCookieService($this->cookieService);
 }
 public function setUp()
 {
     parent::setUp();
     $this->service = new CookieAuthenticationService();
     $this->authService = $this->getMock('Zend\\Authentication\\AuthenticationServiceInterface');
     $this->service->setAuthService($this->authService);
     $this->rememberMeService = $this->getMock('JwPersistentUser\\Service\\RememberMeService');
     $this->service->setRememberMeService($this->rememberMeService);
     $this->cookieService = $this->getMock('JwPersistentUser\\Service\\CookieService');
     $this->service->setCookieService($this->cookieService);
     $this->userMapper = $this->getMock('ZfcUser\\Mapper\\User');
     $this->service->setUserMapper($this->userMapper);
 }
 public function setUp()
 {
     parent::setUp();
     $this->service = new RememberMeService();
     $this->mapper = $this->getMock('JwPersistentUser\\Mapper\\SerieTokenMapperInterface');
     $this->service->setMapper($this->mapper);
     $this->service->setModuleOptions($this->options = new ModuleOptions());
     $this->options->setSerieTokenEntityClass('JwPersistentUser\\Model\\SerieToken');
     $ipService = $this->getMock('Zend\\Http\\PhpEnvironment\\RemoteAddress');
     $ipService->expects($this->any())->method('getIpAddress')->will($this->returnValue(self::IP));
     $this->service->setIpService($ipService);
     $request = $this->getMock('Zend\\Http\\Request');
     $request->expects($this->any())->method('getHeader')->with('UserAgent')->will($this->returnValue(new UserAgent(self::USER_AGENT)));
     $this->service->setRequest($request);
 }