Gc\Mvc\Listener\DocumentListenerTest::testOnRouteWithHomePage PHP Méthode

testOnRouteWithHomePage() public méthode

test
public testOnRouteWithHomePage ( ) : void
Résultat void
    public function testOnRouteWithHomePage()
    {
        $this->createDocuments();
        $route = Mockery::mock('Zend\\Mvc\\Router\\Http\\RouteMatch');
        $route->shouldReceive('getMatchedRouteName')->once()->andReturn('cms');
        $route->shouldReceive('getParam')->with('path')->once()->andReturn('/children/');
        $events = Mockery::mock('Zend\\EventManager\\EventInterface');
        $events->shouldReceive('getRouteMatch')->once()->andReturn($route);
        $identity = Mockery::mock('Zend\\Authentication\\AuthenticationService');
        $identity->shouldReceive('hasIdentity')->andReturn(false);
        $serviceManager = Mockery::mock('Zend\\ServiceManager\\ServiceManager');
        $serviceManager->shouldReceive('get')->with('Auth')->andReturn($identity);
        $serviceManager->shouldReceive('setService')->with('CurrentDocument', Mockery::any())->once();
        $application = Mockery::mock('Zend\\Mvc\\Application');
        $application->shouldReceive('getServiceManager')->once()->andReturn($serviceManager);
        $events->shouldReceive('getApplication')->once()->andReturn($application);
        $this->assertNull($this->object->onRoute($events));
        $this->deleteDocuments();
    }