2017-08-24 10:06:37 -04:00
|
|
|
<?php
|
2025-04-27 08:38:18 -04:00
|
|
|
|
2017-08-24 10:06:37 -04:00
|
|
|
/**
|
2024-05-10 09:09:14 -04:00
|
|
|
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2017-08-24 10:06:37 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace Test\Command;
|
|
|
|
|
|
|
|
|
|
use OC\Command\CronBus;
|
|
|
|
|
use Test\BackgroundJob\DummyJobList;
|
|
|
|
|
|
|
|
|
|
class CronBusTest extends AsyncBusTest {
|
|
|
|
|
/**
|
|
|
|
|
* @var \OCP\BackgroundJob\IJobList
|
|
|
|
|
*/
|
|
|
|
|
private $jobList;
|
|
|
|
|
|
|
|
|
|
|
2019-11-27 09:27:18 -05:00
|
|
|
protected function setUp(): void {
|
2017-08-24 10:06:37 -04:00
|
|
|
parent::setUp();
|
|
|
|
|
|
|
|
|
|
$this->jobList = new DummyJobList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function createBus() {
|
|
|
|
|
return new CronBus($this->jobList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function runJobs() {
|
|
|
|
|
$jobs = $this->jobList->getAll();
|
|
|
|
|
foreach ($jobs as $job) {
|
2024-02-08 05:52:40 -05:00
|
|
|
$job->start($this->jobList);
|
2017-08-24 10:06:37 -04:00
|
|
|
}
|
|
|
|
|
}
|
2017-09-04 08:21:44 -04:00
|
|
|
}
|