mirror of
https://github.com/karatektus/pl_mail.git
synced 2026-10-25 10:04:18 +00:00
fix(test): the shared-calendar window is asserted in the zone it renders in
The expectation composed "today" in the runner's default timezone while the page renders the share owner's (Europe/Berlin) — so every evening run after Berlin crossed midnight ahead of a UTC container failed on a date that was correct on the page. Pre-existing; tonight's runs merely sat in the failing window long enough to notice. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2828dc31dc
commit
422dc40141
1 file changed
+9
-2
@@ -151,14 +151,21 @@ final class PublicCalendarStyleTest extends WebTestCase
|
||||
// arranged the one way PHP arranges it for every language, which is the
|
||||
// defect |intl_date exists to remove — and this page is public, so its
|
||||
// reader's locale is the least predictable in the app.
|
||||
// In the SHARE OWNER's timezone, because that is the zone the page
|
||||
// renders the window in. Composed in the runner's default zone this
|
||||
// asserted "today" about a page whose today can already be tomorrow —
|
||||
// Europe/Berlin runs ahead of a UTC container, so every evening run
|
||||
// after 22:00 UTC failed on a date that was correct on the page.
|
||||
$zone = new \DateTimeZone('Europe/Berlin');
|
||||
|
||||
$expected = (new \IntlDateFormatter(
|
||||
'en',
|
||||
\IntlDateFormatter::NONE,
|
||||
\IntlDateFormatter::NONE,
|
||||
new DateTimeImmutable('today')->getTimezone(),
|
||||
$zone,
|
||||
\IntlDateFormatter::GREGORIAN,
|
||||
(new \IntlDatePatternGenerator('en'))->getBestPattern('dMMMy'),
|
||||
))->format(new DateTimeImmutable('today'));
|
||||
))->format(new DateTimeImmutable('today', $zone));
|
||||
|
||||
self::assertStringContainsString((string) $expected, $body);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user