2015-02-28 15:56:40 -05:00
|
|
|
<?php
|
|
|
|
|
/**
|
2024-05-10 09:09:14 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016-2023 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2015 Christian Kampka <christian@kampka.net>
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
2020-04-08 16:24:54 -04:00
|
|
|
*/
|
2015-02-28 15:56:40 -05:00
|
|
|
namespace Test\Command;
|
|
|
|
|
|
2019-11-22 14:52:10 -05:00
|
|
|
use OC\Core\Command\Background\Ajax;
|
2015-02-28 15:56:40 -05:00
|
|
|
use OC\Core\Command\Background\Cron;
|
|
|
|
|
use OC\Core\Command\Background\WebCron;
|
2019-11-22 14:52:10 -05:00
|
|
|
|
|
|
|
|
use Symfony\Component\Console\Input\StringInput;
|
|
|
|
|
use Symfony\Component\Console\Output\NullOutput;
|
|
|
|
|
use Test\TestCase;
|
2015-02-28 15:56:40 -05:00
|
|
|
|
2016-05-20 09:38:20 -04:00
|
|
|
class BackgroundJobsTest extends TestCase {
|
2015-02-28 15:56:40 -05:00
|
|
|
public function testCronCommand() {
|
|
|
|
|
$config = \OC::$server->getConfig();
|
|
|
|
|
$job = new Cron($config);
|
|
|
|
|
$job->run(new StringInput(''), new NullOutput());
|
|
|
|
|
$this->assertEquals('cron', $config->getAppValue('core', 'backgroundjobs_mode'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testAjaxCommand() {
|
|
|
|
|
$config = \OC::$server->getConfig();
|
|
|
|
|
$job = new Ajax($config);
|
|
|
|
|
$job->run(new StringInput(''), new NullOutput());
|
|
|
|
|
$this->assertEquals('ajax', $config->getAppValue('core', 'backgroundjobs_mode'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function testWebCronCommand() {
|
|
|
|
|
$config = \OC::$server->getConfig();
|
|
|
|
|
$job = new WebCron($config);
|
|
|
|
|
$job->run(new StringInput(''), new NullOutput());
|
|
|
|
|
$this->assertEquals('webcron', $config->getAppValue('core', 'backgroundjobs_mode'));
|
|
|
|
|
}
|
|
|
|
|
}
|