eZ\Publish\Core\Limitation\Tests\LocationLimitationTypeTest::testValidatePass PHP Method

testValidatePass() public method

public testValidatePass ( eZ\Publish\API\Repository\Values\User\Limitation\LocationLimitation $limitation )
$limitation eZ\Publish\API\Repository\Values\User\Limitation\LocationLimitation
    public function testValidatePass(LocationLimitation $limitation)
    {
        if (!empty($limitation->limitationValues)) {
            $this->getPersistenceMock()->expects($this->any())->method('locationHandler')->will($this->returnValue($this->locationHandlerMock));
            foreach ($limitation->limitationValues as $key => $value) {
                $this->locationHandlerMock->expects($this->at($key))->method('load')->with($value);
            }
        }
        // Need to create inline instead of depending on testConstruct() to get correct mock instance
        $limitationType = $this->testConstruct();
        $validationErrors = $limitationType->validate($limitation);
        self::assertEmpty($validationErrors);
    }