2017-08-24 10:06:37 -04:00
|
|
|
<?php
|
2025-06-30 09:04:05 -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;
|
2025-06-30 10:56:59 -04:00
|
|
|
use OCP\BackgroundJob\IJobList;
|
2017-08-24 10:06:37 -04:00
|
|
|
use Test\BackgroundJob\DummyJobList;
|
|
|
|
|
|
2025-10-20 19:52:40 -04:00
|
|
|
#[\PHPUnit\Framework\Attributes\Group('DB')]
|
2025-05-09 11:14:51 -04:00
|
|
|
class CronBusTest extends AsyncBusTestCase {
|
2017-08-24 10:06:37 -04:00
|
|
|
/**
|
2025-06-30 10:56:59 -04:00
|
|
|
* @var IJobList
|
2017-08-24 10:06:37 -04:00
|
|
|
*/
|
|
|
|
|
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
|
|
|
}
|