diff --git a/src/Symfony/Component/Validator/Tests/Validator/AbstractValidatorTest.php b/src/Symfony/Component/Validator/Tests/Validator/AbstractValidatorTest.php index 952f5111a7..2236d6cb02 100644 --- a/src/Symfony/Component/Validator/Tests/Validator/AbstractValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Validator/AbstractValidatorTest.php @@ -851,6 +851,17 @@ abstract class AbstractValidatorTest extends \PHPUnit_Framework_TestCase $this->validateProperty('VALUE', 'someProperty'); } + /** + * https://github.com/symfony/symfony/issues/11604 + */ + public function testValidatePropertyWithoutConstraints() + { + $entity = new Entity(); + $violations = $this->validateProperty($entity, 'lastName'); + + $this->assertCount(0, $violations, '->validateProperty() returns no violations if no constraints have been configured for the property being validated'); + } + public function testValidatePropertyValue() { $test = $this; @@ -970,6 +981,17 @@ abstract class AbstractValidatorTest extends \PHPUnit_Framework_TestCase $this->validatePropertyValue('VALUE', 'someProperty', 'someValue'); } + /** + * https://github.com/symfony/symfony/issues/11604 + */ + public function testValidatePropertyValueWithoutConstraints() + { + $entity = new Entity(); + $violations = $this->validatePropertyValue($entity, 'lastName', 'foo'); + + $this->assertCount(0, $violations, '->validatePropertyValue() returns no violations if no constraints have been configured for the property being validated'); + } + public function testValidateObjectOnlyOncePerGroup() { $entity = new Entity();