From e8e0f97c9a934ba9da4f4f4c092a5f8683500164 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 17 May 2022 00:52:16 +0200 Subject: Port BackgroundJob admin settings to vue Signed-off-by: Carl Schwan --- apps/settings/tests/Settings/Admin/ServerTest.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'apps/settings/tests/Settings') diff --git a/apps/settings/tests/Settings/Admin/ServerTest.php b/apps/settings/tests/Settings/Admin/ServerTest.php index acabf9abf5e..c5958c29421 100644 --- a/apps/settings/tests/Settings/Admin/ServerTest.php +++ b/apps/settings/tests/Settings/Admin/ServerTest.php @@ -38,6 +38,7 @@ use OCP\AppFramework\Services\IInitialState; use OCP\AppFramework\Utility\ITimeFactory; use OCP\IConfig; use OCP\IDBConnection; +use OCP\IUrlGenerator; use OCP\IL10N; use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; @@ -60,6 +61,8 @@ class ServerTest extends TestCase { private $config; /** @var IL10N|MockObject */ private $l10n; + /** @var IUrlGenerator|MockObject */ + private $urlGenerator; protected function setUp(): void { parent::setUp(); @@ -69,6 +72,7 @@ class ServerTest extends TestCase { $this->timeFactory = $this->createMock(ITimeFactory::class); $this->config = $this->createMock(IConfig::class); $this->l10n = $this->createMock(IL10N::class); + $this->urlGenerator = $this->createMock(IUrlGenerator::class); $this->admin = $this->getMockBuilder(Server::class) ->onlyMethods(['cronMaxAge']) @@ -77,6 +81,7 @@ class ServerTest extends TestCase { $this->initialStateService, $this->profileManager, $this->timeFactory, + $this->urlGenerator, $this->config, $this->l10n, ]) @@ -95,8 +100,8 @@ class ServerTest extends TestCase { $this->config ->expects($this->at(1)) ->method('getAppValue') - ->with('core', 'lastcron', false) - ->willReturn(false); + ->with('core', 'lastcron', '0') + ->willReturn('0'); $this->config ->expects($this->at(2)) ->method('getAppValue') @@ -110,12 +115,6 @@ class ServerTest extends TestCase { 'settings', 'settings/admin/server', [ - 'backgroundjobs_mode' => 'ajax', - 'lastcron' => false, - 'cronErrors' => '', - 'cronMaxAge' => 1337, - 'cli_based_cron_possible' => true, - 'cli_based_cron_user' => function_exists('posix_getpwuid') ? posix_getpwuid(fileowner(\OC::$configDir . 'config.php'))['name'] : '', // to not explode here because of posix extension not being disabled - which is already checked in the line above 'profileEnabledGlobally' => true, ], '' -- cgit v1.2.3