Skip to content

Commit

Permalink
Merge branch '6.4' into 7.1
Browse files Browse the repository at this point in the history
* 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`
  • Loading branch information
nicolas-grekas committed Aug 13, 2024
2 parents dcbef13 + 44fa633 commit 8b664c8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Tests/Constraints/TimeValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,19 @@ public function testValidTimesWithoutSeconds(string $time)
$this->assertNoViolation();
}

/**
* @dataProvider getValidTimesWithoutSeconds
*/
public function testValidTimesWithoutSecondsWithNewLine(string $time)
{
$this->validator->validate($time."\n", new Time(withSeconds: false));

$this->buildViolation('This value is not a valid time.')
->setParameter('{{ value }}', '"'.$time."\n".'"')
->setCode(Time::INVALID_FORMAT_ERROR)
->assertRaised();
}

public static function getValidTimesWithoutSeconds()
{
return [
Expand Down

0 comments on commit 8b664c8

Please sign in to comment.