eZ\Publish\Core\MVC\Symfony\Matcher\Tests\ContentBased\DepthTest::generateRepositoryMockForDepth PHP Метод

generateRepositoryMockForDepth() приватный Метод

Returns a Repository mock configured to return the appropriate Location object with given parent location Id.
private generateRepositoryMockForDepth ( integer $depth ) : PHPUnit_Framework_MockObject_MockObject
$depth integer
Результат PHPUnit_Framework_MockObject_MockObject
    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;
    }