yield ['every 20 seconds',
new PeriodicalTrigger(20,
$from,
$until)];
yield ['every 20 seconds',
new PeriodicalTrigger('20',
$from,
$until)];
yield ['every 2 seconds (PT2S)',
new PeriodicalTrigger('PT2S',
$from,
$until)];
yield ['every 20 seconds',
new PeriodicalTrigger('20 seconds',
$from,
$until)];
yield ['every 4 minutes 20 seconds',
new PeriodicalTrigger('4 minutes 20 seconds',
$from,
$until)];
yield ['every 2 hours',
new PeriodicalTrigger('2 hours',
$from,
$until)];
yield ['every 2 seconds',
new PeriodicalTrigger(new \
DateInterval('PT2S'
),
$from,
$until)];
yield ['DateInterval',
new PeriodicalTrigger(new \
DateInterval('P1D'
),
$from,
$until)];
if (\PHP_VERSION_ID >= 80200
) { yield ['last day of next month',
new PeriodicalTrigger(\DateInterval::
createFromDateString('last day of next month'
),
$from,
$until)];
} } /**
* @dataProvider providerGetNextRunDates
*/
public function testGetNextRunDates(\DateTimeImmutable
$from, TriggerInterface
$trigger, array
$expected, int
$count = 0
) { $this->
assertEquals($expected,
$this->
getNextRunDates($from,
$trigger,
$count ?? \
count($expected)));
}