public acceptValue ( eZ\Publish\API\Repository\Values\User\Limitation $limitationValue ) | ||
$limitationValue | eZ\Publish\API\Repository\Values\User\Limitation |
public function acceptValue(APILimitationValue $limitationValue)
{
if (!$limitationValue instanceof APISubtreeLimitation) {
throw new InvalidArgumentType('$limitationValue', 'APISubtreeLimitation', $limitationValue);
} elseif (!is_array($limitationValue->limitationValues)) {
throw new InvalidArgumentType('$limitationValue->limitationValues', 'array', $limitationValue->limitationValues);
}
foreach ($limitationValue->limitationValues as $key => $path) {
if (!is_string($path)) {
throw new InvalidArgumentType("\$limitationValue->limitationValues[{$key}]", 'string', $path);
}
}
}
/** * @dataProvider providerForTestAcceptValueException * @depends testConstruct * @expectedException \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException * * @param \eZ\Publish\API\Repository\Values\User\Limitation $limitation * @param \eZ\Publish\Core\Limitation\SubtreeLimitationType $limitationType */ public function testAcceptValueException(Limitation $limitation, SubtreeLimitationType $limitationType) { $limitationType->acceptValue($limitation); }