@@ -59,26 +59,29 @@ class TimestampableElementProviderTest extends WebTestCase
59
59
protected function setUp (): void
60
60
{
61
61
self ::bootKernel ();
62
- \Locale::setDefault ('en ' );
62
+ \Locale::setDefault ('en_US ' );
63
63
$ this ->service = self ::getContainer ()->get (TimestampableElementProvider::class);
64
- $ this ->target = new class () implements TimeStampableInterface {
64
+ $ this ->target = new class () implements TimeStampableInterface {
65
65
public function getLastModified (): ?DateTime
66
66
{
67
- return new \ DateTime ('2000-01-01 ' );
67
+ return new DateTime ('2000-01-01 ' );
68
68
}
69
69
70
70
public function getAddedDate (): ?DateTime
71
71
{
72
- return new \ DateTime ('2000-01-01 ' );
72
+ return new DateTime ('2000-01-01 ' );
73
73
}
74
74
};
75
75
}
76
76
77
77
public function dataProvider (): \Iterator
78
78
{
79
- \Locale::setDefault ('en ' );
80
- yield ['1/1/00, 12:00 AM ' , '[[LAST_MODIFIED]] ' ];
81
- yield ['1/1/00, 12:00 AM ' , '[[CREATION_DATE]] ' ];
79
+ \Locale::setDefault ('en_US ' );
80
+ // Use IntlDateFormatter like the actual service does
81
+ $ formatter = new \IntlDateFormatter (\Locale::getDefault (), \IntlDateFormatter::SHORT , \IntlDateFormatter::SHORT );
82
+ $ expectedFormat = $ formatter ->format (new DateTime ('2000-01-01 ' ));
83
+ yield [$ expectedFormat , '[[LAST_MODIFIED]] ' ];
84
+ yield [$ expectedFormat , '[[CREATION_DATE]] ' ];
82
85
}
83
86
84
87
/**
0 commit comments