From 11e0df4f55ce19d64c232cb6b60955eff375524c Mon Sep 17 00:00:00 2001 From: Raul Fraile Date: Sat, 8 Dec 2018 10:21:14 +0100 Subject: [PATCH] [Validator] Add tests in regex validator for objects with __toString method --- .../Tests/Constraints/RegexValidatorTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Symfony/Component/Validator/Tests/Constraints/RegexValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/RegexValidatorTest.php index 777fa26693f5..1587392b608e 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/RegexValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/RegexValidatorTest.php @@ -62,6 +62,12 @@ public function getValidValues() array('0'), array('090909'), array(90909), + array(new class() { + public function __toString() + { + return '090909'; + } + }), ); } @@ -88,6 +94,12 @@ public function getInvalidValues() return array( array('abcd'), array('090foo'), + array(new class() { + public function __toString() + { + return 'abcd'; + } + }), ); } }