diff --git a/.github/pr-test-selection.json b/.github/pr-test-selection.json index f3e329153..e329aa8c4 100644 --- a/.github/pr-test-selection.json +++ b/.github/pr-test-selection.json @@ -26,6 +26,7 @@ "tests/Unit/V2/WorkflowFiberRunnerTest.php", "tests/Unit/V2/WorkflowHistoryPayloadCastTest.php", "tests/Unit/V2/WorkflowInstanceIdTest.php", + "tests/Unit/V2/WorkflowScheduleDaylightSavingTest.php", "tests/Unit/V2/WorkflowStepHistoryTest.php" ], "mysql_smoke": [ diff --git a/tests/Unit/V2/WorkflowScheduleDaylightSavingTest.php b/tests/Unit/V2/WorkflowScheduleDaylightSavingTest.php index 65a27ef66..2ae92af6f 100644 --- a/tests/Unit/V2/WorkflowScheduleDaylightSavingTest.php +++ b/tests/Unit/V2/WorkflowScheduleDaylightSavingTest.php @@ -8,8 +8,8 @@ use DateTimeZone; use Illuminate\Support\Carbon; use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; use ReflectionMethod; -use Tests\TestCase; use Workflow\V2\Models\WorkflowSchedule; /** @@ -141,14 +141,12 @@ public function testCronOccurrencesFollowDaylightSavingRules( string $startUtc, array $expected, ): void { - $schedule = new WorkflowSchedule(); - $schedule->spec = [ - 'cron_expressions' => [$expression], - 'timezone' => $timezone, - ]; - $this->assertSame($expected, $this->occurrences( - static fn (DateTimeInterface $after): ?DateTimeInterface => $schedule->computeNextFireAt($after), + static fn (DateTimeInterface $after): ?DateTimeInterface => WorkflowSchedule::nextCronOccurrence( + $expression, + $after, + $timezone + ), $startUtc, count($expected), ));