'scheduledTaskClass' => FooMessage::
class,
'runInterval' => 300,
'defaultRunInterval' => 300,
'status' => ScheduledTaskDefinition::STATUS_FAILED,
'nextExecutionTime' =>
$nextExecutionTime->
modify('-10 seconds'
),
],
], Context::
createDefaultContext());
$this->messageBus->
expects(static::
never()) ->
method('dispatch'
);
$result =
$this->scheduler->
getNextExecutionTime();
static::
assertInstanceOf(\DateTime::
class,
$result);
// when saving the Date to the DB the microseconds aren't saved, so we can't simply compare the datetime objects
static::
assertEquals( $nextExecutionTime->
format(Defaults::STORAGE_DATE_TIME_FORMAT
),
$result->
format(Defaults::STORAGE_DATE_TIME_FORMAT
) );
} public function testGetNextExecutionTimeIgnoresNotScheduledTasks(): void
{ $this->connection->
executeStatement('DELETE FROM scheduled_task'
);