8000 [Scheduler] Fix optional count variable in testGetNextRunDates · codedmonkey/symfony@859e07a · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit 859e07a

Browse files
committed
[Scheduler] Fix optional count variable in testGetNextRunDates
1 parent caa1be7 commit 859e07a

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/Symfony/Component/Scheduler/Tests/Trigger/PeriodicalTriggerTest.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,26 @@ public static function provideForToString()
108108
/**
109109
* @dataProvider providerGetNextRunDates
110110
*/
111-
public function testGetNextRunDates(\DateTimeImmutable $from, TriggerInterface $trigger, array $expected, int $count = 0)
111+
public function testGetNextRunDates(\DateTimeImmutable $from, TriggerInterface $trigger, array $expected, ?int $count = null)
112112
{
113113
$this->assertEquals($expected, $this->getNextRunDates($from, $trigger, $count ?? \count($expected)));
114114
}
115115

116116
public static function providerGetNextRunDates(): iterable
117117
{
118+
yield [
119+
new \DateTimeImmutable(),
120+
new PeriodicalTrigger('23 hours', '2024-12-07 00:00', '2024-12-20'),
121+
[
122+
new \DateTimeImmutable('2024-12-07 23:00'),
123+
new \DateTimeImmutable('2024-12-08 22:00'),
124+
new \DateTimeImmutable('2024-12-09 21:00'),
125+
new \DateTimeImmutable('2024-12-10 20:00'),
126+
],
127+
];
128+
129+
return;
130+
118131
yield [
119132
new \DateTimeImmutable('2023-03-19 13:45'),
120133
self::createTrigger('next tuesday'),

0 commit comments

Comments
 (0)
0