Skip to content

Commit 8b664c8

Browse files
Merge branch '6.4' into 7.1
* 6.4: Replace external FTP server by a local docker instance [PhpUnitBridge][Console][VarDumper] Fix handling NO_COLOR env var fix test [Validator] Add test for `D` regex modifier in `TimeValidator`
2 parents dcbef13 + 44fa633 commit 8b664c8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Tests/Constraints/TimeValidatorTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,19 @@ public function testValidTimesWithoutSeconds(string $time)
9494
$this->assertNoViolation();
9595
}
9696

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+
97110
public static function getValidTimesWithoutSeconds()
98111
{
99112
return [

0 commit comments

Comments
 (0)