mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fix test: use fixed date instead of 'yesterday'
This commit is contained in:
parent
b85cd1b994
commit
2a9e461d6f
@ -28,7 +28,7 @@ final class BirthdateValidatorTest extends ConstraintValidatorTestCase
|
||||
{
|
||||
public function testTomorrowInvalid()
|
||||
{
|
||||
$bornAfter = new DateTime('+2 days');
|
||||
$bornAfter = new DateTime('2023-08-31');
|
||||
$this->validator->validate($bornAfter, $this->createConstraint());
|
||||
$this->buildViolation('msg')
|
||||
->setParameter('%date%', (new DateTime('2023-08-29'))->format('d-m-Y'))
|
||||
@ -38,7 +38,7 @@ final class BirthdateValidatorTest extends ConstraintValidatorTestCase
|
||||
|
||||
public function testValidateTodayInvalid()
|
||||
{
|
||||
$bornToday = new DateTime('now');
|
||||
$bornToday = new DateTime('2023-08-30');
|
||||
$this->validator->validate($bornToday, $this->createConstraint());
|
||||
$this->buildViolation('msg')
|
||||
->setParameter('%date%', (new DateTime('2023-08-29'))->format('d-m-Y'))
|
||||
@ -59,7 +59,7 @@ final class BirthdateValidatorTest extends ConstraintValidatorTestCase
|
||||
|
||||
public function testValidateYesterdayValid()
|
||||
{
|
||||
$bornYesterday = new DateTime('yesterday');
|
||||
$bornYesterday = new DateTime('2023-08-29');
|
||||
$this->validator->validate($bornYesterday, $this->createConstraint());
|
||||
$this->assertNoViolation();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user