public function testOnRouteWithRealPath()
{
$this->createDocuments();
$route = Mockery::mock('Zend\\Mvc\\Router\\Http\\RouteMatch');
$route->shouldReceive('getMatchedRouteName')->once()->andReturn('cms');
$route->shouldReceive('getParam')->with('path')->once()->andReturn('/parent/children/');
$events = Mockery::mock('Zend\\EventManager\\EventInterface');
$events->shouldReceive('getRouteMatch')->once()->andReturn($route);
$translator = Mockery::mock('Zend\\Mvc\\I18n\\Translator');
$translator->shouldReceive('setLocale')->andReturn(true);
$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('get')->with('MvcTranslator')->andReturn($translator);
$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));
AbstractValidator::setDefaultTranslator(null);
$this->deleteDocuments();
}