diff --git a/src/Symfony/Component/Validator/Validator.php b/src/Symfony/Component/Validator/Validator.php index d20a623256..54ae2f9456 100644 --- a/src/Symfony/Component/Validator/Validator.php +++ b/src/Symfony/Component/Validator/Validator.php @@ -108,7 +108,7 @@ class Validator implements ValidatorInterface return $walker->walkConstraint($constraint, $value, $group, ''); }; - return $this->validateGraph($value, $walk, $groups); + return $this->validateGraph('', $walk, $groups); } protected function validateGraph($root, \Closure $walk, $groups = null) diff --git a/tests/Symfony/Tests/Component/Validator/ValidatorTest.php b/tests/Symfony/Tests/Component/Validator/ValidatorTest.php index 86c8ee98a6..c161a49970 100644 --- a/tests/Symfony/Tests/Component/Validator/ValidatorTest.php +++ b/tests/Symfony/Tests/Component/Validator/ValidatorTest.php @@ -148,9 +148,16 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase public function testValidateValue() { - $result = $this->validator->validateValue('Bernhard', new FailingConstraint()); + $violations = new ConstraintViolationList(); + $violations->add(new ConstraintViolation( + '', + array(), + '', + '', + 'Bernhard' + )); - $this->assertCount(1, $result); + $this->assertEquals($violations, $this->validator->validateValue('Bernhard', new FailingConstraint())); } public function testGetMetadataFactory()