function it_validates_deprecated_context($constraint, DeprecatedContext $context)
 {
     $context->getGroup()->shouldBeCalled();
     $context->getRoot()->shouldBeCalled();
     $context->validateValue('some value', $constraint->constraints, Argument::any(), Argument::any())->shouldBeCalled();
     $this->initialize($context);
     $this->validate('some value', $constraint);
 }
コード例 #2
0
ファイル: ErrorElement.php プロジェクト: LamaDelRay/test_symf
 /**
  * @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));
     }
 }
コード例 #3
0
ファイル: ConfigStoreForm.php プロジェクト: margery/thelia
 public function checkEmailList($value, ExecutionContextInterface $context)
 {
     $list = preg_split('/[,;]/', $value);
     $emailValidator = new Constraints\Email();
     foreach ($list as $email) {
         $email = trim($email);
         $context->validateValue($email, $emailValidator);
     }
 }
コード例 #4
0
 /**
  * @param \Symfony\Component\Validator\Constraint $constraint
  */
 protected function validate(Constraint $constraint)
 {
     $subPath = (string) $this->getCurrentPropertyPath();
     $this->context->validateValue($this->getValue(), $constraint, $subPath, $this->group);
 }