private function generateRepositoryMockForDepth($depth)
{
$locationServiceMock = $this->getMockBuilder('eZ\\Publish\\API\\Repository\\LocationService')->disableOriginalConstructor()->getMock();
$locationServiceMock->expects($this->once())->method('loadLocation')->with(42)->will($this->returnValue($this->getLocationMock(array('depth' => $depth))));
$repository = $this->getRepositoryMock();
$repository->expects($this->once())->method('getLocationService')->will($this->returnValue($locationServiceMock));
$repository->expects($this->once())->method('getPermissionResolver')->will($this->returnValue($this->getPermissionResolverMock()));
return $repository;
}