feat: answer received form submissions by mail
This commit is contained in:
1 parent
19364df2db
commit
aa728ddc99
22 files changed
+974
-9
No files matched your search
@@ -70,4 +70,35 @@ class SeasonCalendarTest extends TestCase
|
||||
|
||||
(new SeasonCalendar('xx-yy', '04-01'))->seasonYearFor(new \DateTimeImmutable('2025-01-01'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider provideUpcomingSeasonDates
|
||||
*/
|
||||
public function testTheCurrentOrUpcomingSeasonYear(string $date, int $expected): void
|
||||
{
|
||||
$calendar = new SeasonCalendar('11-01', '04-01');
|
||||
|
||||
$this->assertSame($expected, $calendar->currentOrUpcomingSeasonYear(new \DateTimeImmutable($date)));
|
||||
}
|
||||
|
||||
public static function provideUpcomingSeasonDates(): iterable
|
||||
{
|
||||
// Between two seasons: the winter ahead, which is what a recruiting mail means.
|
||||
yield 'September, before the season starts' => ['2026-09-24', 2026];
|
||||
yield 'the day the season starts' => ['2026-11-01', 2026];
|
||||
// Inside a season: that season, not the next one.
|
||||
yield 'December, mid season' => ['2026-12-15', 2026];
|
||||
yield 'the last day of the season' => ['2027-04-01', 2026];
|
||||
// After a season ended, so the next one to start.
|
||||
yield 'May, after the season ended' => ['2027-05-02', 2027];
|
||||
}
|
||||
|
||||
public function testTheShortLabelIsTheTwoDigitSpan(): void
|
||||
{
|
||||
$calendar = new SeasonCalendar('11-01', '04-01');
|
||||
|
||||
$this->assertSame('26/27', $calendar->shortLabel(2026));
|
||||
// The turn of the century has to stay two digits on both ends.
|
||||
$this->assertSame('99/00', $calendar->shortLabel(1999));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user