*/ public static function nights(): iterable { yield 'the day the trip ends' => [0, false]; yield 'first night after' => [1, true]; yield 'last daily night' => [7, true]; yield 'first quiet night' => [8, false]; yield 'still quiet' => [13, false]; yield 'two weeks' => [14, true]; yield 'three weeks' => [21, true]; yield 'between the weeks' => [22, false]; yield 'months later' => [70, true]; } #[DataProvider('nights')] public function testDailyForAWeekThenWeekly(int $nights, bool $due): void { $today = new \DateTimeImmutable('2026-11-20'); $this->assertSame($due, ReminderCadence::isDue($today->modify(sprintf('-%d days', $nights)), $today)); } public function testTheTimeOfDayDoesNotCount(): void { $this->assertTrue(ReminderCadence::isDue(new \DateTimeImmutable('2026-11-13 23:59'), new \DateTimeImmutable('2026-11-20 01:00'))); } }