本文整理汇总了PHP中Symfony\Component\Validator\Context\ExecutionContextInterface::validateValue方法的典型用法代码示例。如果您正苦于以下问题:PHP ExecutionContextInterface::validateValue方法的具体用法?PHP ExecutionContextInterface::validateValue怎么用?PHP ExecutionContextInterface::validateValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Validator\Context\ExecutionContextInterface
的用法示例。
在下文中一共展示了ExecutionContextInterface::validateValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validate
/**
* @param \Symfony\Component\Validator\Constraint $constraint
*/
protected function validate(Constraint $constraint)
{
$subPath = (string) $this->getCurrentPropertyPath();
if ($this->context instanceof LegacyExecutionContextInterface) {
$this->context->validateValue($this->getValue(), $constraint, $subPath, $this->group);
} else {
$this->context->getValidator()->inContext($this->context)->atPath($subPath)->validate($this->getValue(), $constraint, array($this->group));
}
}
示例2: function
function it_does_not_validate_false_condition($constraint, NewContext $context, ValidatorInterface $validator, ContextualValidatorInterface $contextValidator)
{
$constraint->condition = function () {
return false;
};
$context->getObject()->shouldBeCalled();
$context->getValidator()->shouldNotBeCalled();
$context->validateValue(Argument::any(), Argument::any(), Argument::any(), Argument::any())->shouldNotBeCalled();
$this->initialize($context);
$this->validate('some value', $constraint);
}