add test for #11604

Adds a test case for #11604 to avoid regressions. The actual issue
has been fixed in Symfony 2.3 with the merge of #11615.
This commit is contained in:
Christian Flothmann 2014-08-08 10:52:31 +02:00
parent 6b8fe14f3c
commit a47a8848c3
1 changed files with 22 additions and 0 deletions

View File

@ -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();