private MockObject&MessageBusInterface
$messageBus;
private TaskScheduler
$scheduler;
private Connection
$connection;
protected function setUp(): void
{ $this->scheduledTaskRepo =
$this->
getContainer()->
get('scheduled_task.repository'
);
$this->messageBus =
$this->
createMock(MessageBusInterface::
class);
$this->scheduler =
new TaskScheduler($this->scheduledTaskRepo,
$this->messageBus,
new ParameterBag());
$this->connection =
$this->
getContainer()->
get(Connection::
class);
} public function testScheduleTasks(): void
{ $this->connection->
executeStatement('DELETE FROM scheduled_task'
);
$taskId = Uuid::
randomHex();
$this->scheduledTaskRepo->
create([ [