/** * Test * * @return void */ public function testOnFinishWithCache() { $config = Mockery::mock('Gc\\Core\\Config'); $config->shouldReceive('getValue')->with('cache_is_active')->once()->andReturn(true); $identity = Mockery::mock('Zend\\Authentication\\AuthenticationService'); $identity->shouldReceive('hasIdentity')->andReturn(false); $cacheService = Mockery::mock('Gc\\Mvc\\Service\\CacheService'); $cacheService->shouldReceive('save')->once()->andReturn(); $serviceLocator = Mockery::mock('Zend\\Mvc\\MvcEvent'); $serviceLocator->shouldReceive('get')->once()->with('CoreConfig')->andReturn($config); $serviceLocator->shouldReceive('get')->once()->with('Auth')->andReturn($identity); $serviceLocator->shouldReceive('get')->once()->with('CacheService')->andReturn($cacheService); $application = Mockery::Mock('Zend\\Mvc\\Application'); $application->shouldReceive('getServiceManager')->once()->andReturn($serviceLocator); $event = Mockery::mock('Zend\\Mvc\\MvcEvent'); $event->shouldReceive('getApplication')->once()->andReturn($application); $event->shouldReceive('getRequest')->once()->andReturn(Mockery::mock('Zend\\Http\\PhpEnvironment\\Request')); $this->object->onFinish($event); }