We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
D
TimeValidator
1 parent 2320f3d commit 2b2050aCopy full SHA for 2b2050a
src/Symfony/Component/Validator/Tests/Constraints/TimeValidatorTest.php
@@ -94,6 +94,19 @@ public function testValidTimesWithoutSeconds(string $time)
94
$this->assertNoViolation();
95
}
96
97
+ /**
98
+ * @dataProvider getValidTimesWithoutSeconds
99
+ */
100
+ public function testValidTimesWithoutSecondsWithNewLine(string $time)
101
+ {
102
+ $this->validator->validate($time."\n", new Time(withSeconds: false));
103
+
104
+ $this->buildViolation('This value is not a valid time.')
105
+ ->setParameter('{{ value }}', '"'.$time."\n".'"')
106
+ ->setCode(Time::INVALID_FORMAT_ERROR)
107
+ ->assertRaised();
108
+ }
109
110
public static function getValidTimesWithoutSeconds()
111
{
112
return [
0 commit comments