aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Command/CronBusTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Command/CronBusTest.php')
-rw-r--r--tests/lib/Command/CronBusTest.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/lib/Command/CronBusTest.php b/tests/lib/Command/CronBusTest.php
new file mode 100644
index 00000000000..c86cdcb1da0
--- /dev/null
+++ b/tests/lib/Command/CronBusTest.php
@@ -0,0 +1,40 @@
+<?php
+
+/**
+ * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace Test\Command;
+
+use OC\Command\CronBus;
+use OCP\BackgroundJob\IJobList;
+use Test\BackgroundJob\DummyJobList;
+
+/**
+ * @group DB
+ */
+class CronBusTest extends AsyncBusTestCase {
+ /**
+ * @var IJobList
+ */
+ private $jobList;
+
+
+ protected function setUp(): void {
+ 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) {
+ $job->start($this->jobList);
+ }
+ }
+}