protected function setUp() { $storage = $this->getMock('Zend\\Authentication\\Storage\\Session'); $this->storage = $storage; $authEvent = $this->getMock('ZfcUser\\Authentication\\Adapter\\AdapterChainEvent'); $this->authEvent = $authEvent; $options = $this->getMock('ZfcUser\\Options\\ModuleOptions'); $this->options = $options; $mapper = $this->getMock('ZfcUser\\Mapper\\User'); $this->mapper = $mapper; $user = $this->getMock('ZfcUser\\Entity\\User'); $this->user = $user; $this->db = new Db(); $this->db->setStorage($this->storage); $sessionManager = $this->getMock('Zend\\Session\\SessionManager'); \Zend\Session\AbstractContainer::setDefaultManager($sessionManager); }
protected function setUp() { $this->options = $this->getMock('ZfcUser\\Options\\ModuleOptions'); $this->mapper = $this->getMockForAbstractClass('ZfcUser\\Mapper\\UserInterface'); $this->user = $this->getMockForAbstractClass('ZfcUser\\Entity\\UserInterface'); $this->storage = $this->getMockForAbstractClass('Zend\\Authentication\\Storage\\StorageInterface'); $this->authEvent = $this->getMock('ZfcUser\\Authentication\\Adapter\\AdapterChainEvent'); $this->bcrypt = $this->getMock('Zend\\Crypt\\Password\\Bcrypt'); $this->hydrator = $this->getMockForAbstractClass('ZfcUser\\Mapper\\HydratorInterface'); $this->hydrator->expects($this->any())->method('getCryptoService')->will($this->returnValue($this->bcrypt)); $this->services = $this->getMock('Zend\\ServiceManager\\ServiceManager'); $this->services->expects($this->any())->method('get')->will($this->returnValueMap(array(array('zfcuser_module_options', true, $this->options), array('zfcuser_user_mapper', true, $this->mapper), array('zfcuser_user_hydrator', true, $this->hydrator)))); $this->db = new Db(); $this->db->setServiceManager($this->services); $this->db->setStorage($this->storage); $sessionManager = $this->getMock('Zend\\Session\\SessionManager'); \Zend\Session\AbstractContainer::setDefaultManager($sessionManager); }