eZ\Publish\Core\MVC\Symfony\Matcher\Tests\ContentBased\Matcher\Identifier\SectionTest::generateRepositoryMockForSectionIdentifier PHP Method

generateRepositoryMockForSectionIdentifier() private method

Returns a Repository mock configured to return the appropriate Section object with given section identifier.
private generateRepositoryMockForSectionIdentifier ( string $sectionIdentifier ) : PHPUnit_Framework_MockObject_MockObject
$sectionIdentifier string
return PHPUnit_Framework_MockObject_MockObject
    private function generateRepositoryMockForSectionIdentifier($sectionIdentifier)
    {
        $sectionServiceMock = $this->getMockBuilder('eZ\\Publish\\API\\Repository\\SectionService')->disableOriginalConstructor()->getMock();
        $sectionServiceMock->expects($this->once())->method('loadSection')->will($this->returnValue($this->getMockBuilder('eZ\\Publish\\API\\Repository\\Values\\Content\\Section')->setConstructorArgs(array(array('identifier' => $sectionIdentifier)))->getMockForAbstractClass()));
        $repository = $this->getRepositoryMock();
        $repository->expects($this->once())->method('getSectionService')->will($this->returnValue($sectionServiceMock));
        $repository->expects($this->any())->method('getPermissionResolver')->will($this->returnValue($this->getPermissionResolverMock()));
        return $repository;
    }