CronBusTest.php 643 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace Test\Command;
  7. use OC\Command\CronBus;
  8. use Test\BackgroundJob\DummyJobList;
  9. class CronBusTest extends AsyncBusTest {
  10. /**
  11. * @var \OCP\BackgroundJob\IJobList
  12. */
  13. private $jobList;
  14. protected function setUp(): void {
  15. parent::setUp();
  16. $this->jobList = new DummyJobList();
  17. }
  18. protected function createBus() {
  19. return new CronBus($this->jobList);
  20. }
  21. protected function runJobs() {
  22. $jobs = $this->jobList->getAll();
  23. foreach ($jobs as $job) {
  24. $job->start($this->jobList);
  25. }
  26. }
  27. }