eZ\Publish\Core\Limitation\Tests\ParentDepthLimitationTypeTest::providerForTestEvaluate PHP Method

providerForTestEvaluate() public method

public providerForTestEvaluate ( ) : array
return array
    public function providerForTestEvaluate()
    {
        // Mocks for testing Content & VersionInfo objects, should only be used once because of expect rules.
        $contentMock = $this->getMock('eZ\\Publish\\API\\Repository\\Values\\Content\\Content', [], [], '', false);
        $versionInfoMock = $this->getMock('eZ\\Publish\\API\\Repository\\Values\\Content\\VersionInfo', [], [], '', false);
        $contentMock->expects($this->once())->method('getVersionInfo')->will($this->returnValue($versionInfoMock));
        $versionInfoMock->expects($this->once())->method('getContentInfo')->will($this->returnValue(new ContentInfo(['published' => true])));
        $versionInfoMock2 = $this->getMock('eZ\\Publish\\API\\Repository\\Values\\Content\\VersionInfo', [], [], '', false);
        $versionInfoMock2->expects($this->once())->method('getContentInfo')->will($this->returnValue(new ContentInfo(['published' => true])));
        return [['limitation' => new ParentDepthLimitation(), 'object' => new ContentInfo(['published' => true]), 'targets' => [new Location()], 'persistence' => [], 'expected' => false], ['limitation' => new ParentDepthLimitation(['limitationValues' => [2]]), 'object' => new ContentInfo(['published' => true]), 'targets' => [new Location(['depth' => 55])], 'persistence' => [], 'expected' => false], ['limitation' => new ParentDepthLimitation(['limitationValues' => [2]]), 'object' => new ContentInfo(['published' => true]), 'targets' => [new Location(['depth' => 2])], 'persistence' => [], 'expected' => true], ['limitation' => new ParentDepthLimitation(['limitationValues' => [2]]), 'object' => new ContentInfo(['published' => true]), 'targets' => null, 'persistence' => [new Location(['depth' => 2])], 'expected' => true], ['limitation' => new ParentDepthLimitation(['limitationValues' => [2, 43]]), 'object' => new ContentInfo(['published' => true]), 'targets' => null, 'persistence' => [new Location(['depth' => 55])], 'expected' => false], ['limitation' => new ParentDepthLimitation(['limitationValues' => [2]]), 'object' => new ContentInfo(['published' => false]), 'targets' => null, 'persistence' => [new Location(['depth' => 2])], 'expected' => true], ['limitation' => new ParentDepthLimitation(['limitationValues' => [2, 43]]), 'object' => new ContentInfo(['published' => false]), 'targets' => null, 'persistence' => [new Location(['depth' => 55])], 'expected' => false], ['limitation' => new ParentDepthLimitation(['limitationValues' => [2]]), 'object' => $contentMock, 'targets' => [new Location(['depth' => 2])], 'persistence' => [], 'expected' => true], ['limitation' => new ParentDepthLimitation(['limitationValues' => [2]]), 'object' => $versionInfoMock2, 'targets' => [new Location(['depth' => 2])], 'persistence' => [], 'expected' => true], ['limitation' => new ParentDepthLimitation(['limitationValues' => [2]]), 'object' => new ContentCreateStruct(), 'targets' => [], 'persistence' => [], 'expected' => false], ['limitation' => new ParentDepthLimitation(['limitationValues' => [2, 43]]), 'object' => new ContentCreateStruct(), 'targets' => [new LocationCreateStruct(['parentLocationId' => 55])], 'persistence' => [55 => new Location(['depth' => 42])], 'expected' => false], ['limitation' => new ParentDepthLimitation(['limitationValues' => [2, 42]]), 'object' => new ContentCreateStruct(), 'targets' => [new LocationCreateStruct(['parentLocationId' => 43])], 'persistence' => [43 => new Location(['depth' => 42])], 'expected' => true]];
    }