Gc\Mvc\Listener\DocumentListenerTest::testOnRouteWithEmptyPath PHP Method

testOnRouteWithEmptyPath() public method

test
public testOnRouteWithEmptyPath ( ) : void
return void
    public function testOnRouteWithEmptyPath()
    {
        $route = Mockery::mock('Zend\\Mvc\\Router\\Http\\RouteMatch');
        $route->shouldReceive('getMatchedRouteName')->once()->andReturn('cms');
        $route->shouldReceive('getParam')->with('path')->once()->andReturn('');
        $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', false)->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));
    }