diff --git a/tests/Cron/CronExpressionTest.php b/tests/Cron/CronExpressionTest.php index c50f87f..1569a8e 100644 --- a/tests/Cron/CronExpressionTest.php +++ b/tests/Cron/CronExpressionTest.php @@ -820,4 +820,11 @@ public function testIssue134ForeachInvalidArgumentOnHours() $prev = $cron->getPreviousRunDate(new \DateTimeImmutable('2021-09-07T09:36:00Z')); $this->assertEquals(new \DateTime('2021-01-01 00:00:00'), $prev); } + + public function testIssue151ExpressionSupportLW() + { + $cron = new CronExpression('0 10 LW * *'); + $this->assertTrue($cron->isDue(new \DateTimeImmutable('2023-08-31 10:00:00'))); + $this->assertFalse($cron->isDue(new \DateTimeImmutable('2023-08-30 10:00:00'))); + } } diff --git a/tests/Cron/DayOfMonthFieldTest.php b/tests/Cron/DayOfMonthFieldTest.php index 2fea8b1..c4f3bb9 100644 --- a/tests/Cron/DayOfMonthFieldTest.php +++ b/tests/Cron/DayOfMonthFieldTest.php @@ -115,4 +115,10 @@ public function testIncrementAcrossDstChangeLondon(): void $f->increment($d, true); $this->assertSame("2021-03-27 23:59:00", $d->format("Y-m-d H:i:s")); } + + public function testIssue151DOMFieldSupportLW() + { + $f = new DayOfMonthField(); + $this->assertTrue($f->validate('LW')); + } }