Skip to content

Commit

Permalink
Added regression tests for issue #151
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonmantank committed Aug 10, 2023
1 parent 93a3622 commit 13e72fc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/Cron/CronExpressionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')));
}
}
6 changes: 6 additions & 0 deletions tests/Cron/DayOfMonthFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
}

0 comments on commit 13e72fc

Please # to comment.