eZ\Publish\Core\MVC\Symfony\Matcher\Tests\ContentBased\Matcher\Id\ParentContentTypeTest::generateRepositoryMockForContentTypeId PHP Method

generateRepositoryMockForContentTypeId() private method

Returns a Repository mock configured to return the appropriate ContentType object with given id.
private generateRepositoryMockForContentTypeId ( integer $contentTypeId ) : PHPUnit_Framework_MockObject_MockObject
$contentTypeId integer
return PHPUnit_Framework_MockObject_MockObject
    private function generateRepositoryMockForContentTypeId($contentTypeId)
    {
        $parentContentInfo = $this->getContentInfoMock(array('contentTypeId' => $contentTypeId));
        $parentLocation = $this->getLocationMock();
        $parentLocation->expects($this->once())->method('getContentInfo')->will($this->returnValue($parentContentInfo));
        $locationServiceMock = $this->getMockBuilder('eZ\\Publish\\API\\Repository\\LocationService')->disableOriginalConstructor()->getMock();
        $locationServiceMock->expects($this->atLeastOnce())->method('loadLocation')->will($this->returnValue($parentLocation));
        // The following is used in the case of a match by contentInfo
        $locationServiceMock->expects($this->any())->method('loadLocation')->will($this->returnValue($this->getLocationMock()));
        $repository = $this->getRepositoryMock();
        $repository->expects($this->any())->method('getLocationService')->will($this->returnValue($locationServiceMock));
        $repository->expects($this->any())->method('getPermissionResolver')->will($this->returnValue($this->getPermissionResolverMock()));
        return $repository;
    }