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

Load the page contents from the cache and set the response.
public onRoute ( MvcEvent $e ) : Zend\Stdlib\ResponseInterface | void
$e Zend\Mvc\MvcEvent Mvc Event
Результат Zend\Stdlib\ResponseInterface | void
Пример #1
0
 /**
  * Test
  *
  * @return void
  */
 public function testOnRouteWithCacheActivatedWithoutIdentityAndWithoutHttpRequest()
 {
     $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);
     $serviceLocator = Mockery::mock('Zend\\Mvc\\MvcEvent');
     $serviceLocator->shouldReceive('get')->once()->with('CoreConfig')->andReturn($config);
     $serviceLocator->shouldReceive('get')->once()->with('Auth')->andReturn($identity);
     $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(null);
     $this->object->onRoute($event);
 }