diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-06-20 14:44:02 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-06-28 18:00:39 +0200 |
commit | 14778811b4c019cfdc090a64e3baf0ab4bef9f8e (patch) | |
tree | f0394c2ec98ba3cde38f081f8496cc4b853136c6 /tests | |
parent | 4d6a21a3795355a4e94d60dcc468db81fdc4a47e (diff) | |
download | nextcloud-server-14778811b4c019cfdc090a64e3baf0ab4bef9f8e.tar.gz nextcloud-server-14778811b4c019cfdc090a64e3baf0ab4bef9f8e.zip |
refactor: Use `IAppConfig` for setting cron type
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Command/BackgroundJobsTest.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/lib/Command/BackgroundJobsTest.php b/tests/lib/Command/BackgroundJobsTest.php index 310f1057bb4..f066cb5b28a 100644 --- a/tests/lib/Command/BackgroundJobsTest.php +++ b/tests/lib/Command/BackgroundJobsTest.php @@ -9,30 +9,30 @@ namespace Test\Command; use OC\Core\Command\Background\Ajax; use OC\Core\Command\Background\Cron; use OC\Core\Command\Background\WebCron; - +use OCP\IAppConfig; use Symfony\Component\Console\Input\StringInput; use Symfony\Component\Console\Output\NullOutput; use Test\TestCase; class BackgroundJobsTest extends TestCase { public function testCronCommand() { - $config = \OC::$server->getConfig(); - $job = new Cron($config); + $appConfig = \OCP\Server::get(IAppConfig::class); + $job = new Cron($appConfig); $job->run(new StringInput(''), new NullOutput()); - $this->assertEquals('cron', $config->getAppValue('core', 'backgroundjobs_mode')); + $this->assertEquals('cron', $appConfig->getValueString('core', 'backgroundjobs_mode')); } public function testAjaxCommand() { - $config = \OC::$server->getConfig(); - $job = new Ajax($config); + $appConfig = \OCP\Server::get(IAppConfig::class); + $job = new Ajax($appConfig); $job->run(new StringInput(''), new NullOutput()); - $this->assertEquals('ajax', $config->getAppValue('core', 'backgroundjobs_mode')); + $this->assertEquals('ajax', $appConfig->getValueString('core', 'backgroundjobs_mode')); } public function testWebCronCommand() { - $config = \OC::$server->getConfig(); - $job = new WebCron($config); + $appConfig = \OCP\Server::get(IAppConfig::class); + $job = new WebCron($appConfig); $job->run(new StringInput(''), new NullOutput()); - $this->assertEquals('webcron', $config->getAppValue('core', 'backgroundjobs_mode')); + $this->assertEquals('webcron', $appConfig->getValueString('core', 'backgroundjobs_mode')); } } |