$registeredTask->
setRunInterval(CleanupCartTask::
getDefaultInterval());
$registeredTask->
setDefaultRunInterval(CleanupCartTask::
getDefaultInterval());
$registeredTask->
setStatus(ScheduledTaskDefinition::STATUS_SCHEDULED
);
$registeredTask->
setNextExecutionTime(new \
DateTimeImmutable());
$registeredTask->
setScheduledTaskClass(CleanupCartTask::
class);
/** @var StaticEntityRepository<ScheduledTaskCollection> $staticRepository */
$staticRepository =
new StaticEntityRepository([ new ScheduledTaskCollection([$registeredTask]),
]);
(new TaskRegistry($tasks,
$staticRepository,
$parameterBag))->
registerTasks();
static::
assertSame( [ [ [ 'name' => InvalidateCacheTask::
getTaskName(),
'scheduledTaskClass' => InvalidateCacheTask::
class,
'runInterval' => InvalidateCacheTask::
getDefaultInterval(),
'defaultRunInterval' => InvalidateCacheTask::
getDefaultInterval(),
'status' => ScheduledTaskDefinition::STATUS_SCHEDULED,
],
],