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