public function testConstraintsValidatorCanBeModified() { $validator = Validation::createValidatorBuilder()->enableAnnotationMapping()->getValidator(); Configuration::setConstraintsValidator($validator); $returnedValidator = Configuration::getConstraintsValidator(); $this->assertEquals($validator, $returnedValidator); }
/** * Validates the given value compared to given property constraints. * If the value is valid, a call to `count` to the object returned * by this method should give 0. * * @param object $object The object to compare. * @param string $property The name of the reference property. * @param mixed $value The value to check. * * @return Symfony\Component\Validator\ConstraintViolationList * The list of constraints violations the check returns. */ public static function validatePropertyValue($object, $property, $value) { return Configuration::getConstraintsValidator()->validatePropertyValue($object, $property, $value); }