eZ\Publish\Core\MVC\Symfony\Matcher\Tests\ContentBased\Matcher\Id\ParentLocationTest::generateRepositoryMockForParentLocationId PHP Method

generateRepositoryMockForParentLocationId() private method

Returns a Repository mock configured to return the appropriate Location object with given parent location Id.
private generateRepositoryMockForParentLocationId ( integer $parentLocationId ) : PHPUnit_Framework_MockObject_MockObject
$parentLocationId integer
return PHPUnit_Framework_MockObject_MockObject
    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;
    }