eZ\Publish\Core\Limitation\Tests\LocationLimitationTypeTest::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', array(), array(), '', false);
        $versionInfoMock = $this->getMock('eZ\\Publish\\API\\Repository\\Values\\Content\\VersionInfo', array(), array(), '', false);
        $contentMock->expects($this->once())->method('getVersionInfo')->will($this->returnValue($versionInfoMock));
        $versionInfoMock->expects($this->once())->method('getContentInfo')->will($this->returnValue(new ContentInfo(array('published' => true))));
        $versionInfoMock2 = $this->getMock('eZ\\Publish\\API\\Repository\\Values\\Content\\VersionInfo', array(), array(), '', false);
        $versionInfoMock2->expects($this->once())->method('getContentInfo')->will($this->returnValue(new ContentInfo(array('published' => true))));
        return array(array('limitation' => new LocationLimitation(), 'object' => new ContentInfo(array('published' => true)), 'targets' => array(new Location()), 'persistence' => array(), 'expected' => false), array('limitation' => new LocationLimitation(array('limitationValues' => array(2))), 'object' => new ContentInfo(array('published' => true)), 'targets' => array(new Location(array('id' => 55))), 'persistence' => array(), 'expected' => false), array('limitation' => new LocationLimitation(array('limitationValues' => array(2))), 'object' => new ContentInfo(array('published' => true)), 'targets' => array(new Location(array('id' => 2))), 'persistence' => array(), 'expected' => true), array('limitation' => new LocationLimitation(array('limitationValues' => array(2))), 'object' => new ContentInfo(array('published' => true)), 'targets' => null, 'persistence' => array(new Location(array('id' => 2))), 'expected' => true), array('limitation' => new LocationLimitation(array('limitationValues' => array(2, 43))), 'object' => new ContentInfo(array('published' => true)), 'targets' => null, 'persistence' => array(new Location(array('id' => 55))), 'expected' => false), array('limitation' => new LocationLimitation(array('limitationValues' => array(2))), 'object' => new ContentInfo(array('published' => false)), 'targets' => null, 'persistence' => array(new Location(array('id' => 2))), 'expected' => true), array('limitation' => new LocationLimitation(array('limitationValues' => array(2, 43))), 'object' => new ContentInfo(array('published' => false)), 'targets' => null, 'persistence' => array(new Location(array('id' => 55))), 'expected' => false), array('limitation' => new LocationLimitation(array('limitationValues' => array(2))), 'object' => $contentMock, 'targets' => array(new Location(array('id' => 2))), 'persistence' => array(), 'expected' => true), array('limitation' => new LocationLimitation(array('limitationValues' => array(2))), 'object' => $versionInfoMock2, 'targets' => array(new Location(array('id' => 2))), 'persistence' => array(), 'expected' => true), array('limitation' => new LocationLimitation(array('limitationValues' => array(2))), 'object' => new ContentCreateStruct(), 'targets' => array(), 'persistence' => array(), 'expected' => false), array('limitation' => new LocationLimitation(array('limitationValues' => array(2, 43))), 'object' => new ContentCreateStruct(), 'targets' => array(new LocationCreateStruct(array('parentLocationId' => 55))), 'persistence' => array(), 'expected' => false), array('limitation' => new LocationLimitation(array('limitationValues' => array(2, 43))), 'object' => new ContentCreateStruct(), 'targets' => array(new LocationCreateStruct(array('parentLocationId' => 43))), 'persistence' => array(), 'expected' => true));
    }