diff --git a/src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php index 5406b354ce..e496245c0a 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php @@ -35,6 +35,13 @@ class UrlValidatorTest extends AbstractConstraintValidatorTest $this->assertNoViolation(); } + public function testEmptyStringFromObjectIsValid() + { + $this->validator->validate(new EmailProvider(), new Url()); + + $this->assertNoViolation(); + } + /** * @expectedException \Symfony\Component\Validator\Exception\UnexpectedTypeException */ @@ -171,3 +178,11 @@ class UrlValidatorTest extends AbstractConstraintValidatorTest ); } } + +class EmailProvider +{ + public function __toString() + { + return ''; + } +}