Gc\Mvc\Listener\CacheListenerTest::testOnRouteWithCacheActivatedAndWithOutIdentityAndWithoutData PHP Метод

testOnRouteWithCacheActivatedAndWithOutIdentityAndWithoutData() публичный Метод

Test
    public function testOnRouteWithCacheActivatedAndWithOutIdentityAndWithoutData()
    {
        $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('load')->once()->andReturn(null);
        $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->onRoute($event);
    }