/** * @dataProvider dataForTestIsCallableConstraintAnnotation */ public function testIsCallableConstraintAnnotation($constraint, $result) { $this->assertEquals($result, Tools::isCallableConstraintAnnotation($constraint)); }
/** * @Assert\IsTrue(message = "Property has invalid validation constraint! Insert only constraint class with parameters eg. NotBlank() or Email(message = 'Invalid email')") */ public function hasAllCallableConstraintIfHasAny() { if (false == $this->hasConstraints()) { return true; } foreach ($this->getConstraintAnnotationCollection() as $constraintAnnotation) { if (false == Tools::isCallableConstraintAnnotation($constraintAnnotation)) { return false; } } return true; }