diff options
-rw-r--r-- | lib/Service/StatusService.php | 2 | ||||
-rw-r--r-- | tests/Unit/Service/StatusServiceTest.php | 36 |
2 files changed, 13 insertions, 25 deletions
diff --git a/lib/Service/StatusService.php b/lib/Service/StatusService.php index c2daa0c0b..acfdf6be1 100644 --- a/lib/Service/StatusService.php +++ b/lib/Service/StatusService.php @@ -38,7 +38,7 @@ class StatusService public function isProperlyConfigured(): bool { - $cronMode = $this->settings->getSystemValue('backgroundjobs_mode'); + $cronMode = $this->settings->getAppValue('core', 'backgroundjobs_mode'); $cronOff = !$this->settings->getAppValue( Application::NAME, 'useCronUpdates', diff --git a/tests/Unit/Service/StatusServiceTest.php b/tests/Unit/Service/StatusServiceTest.php index ee2e19614..8ffed5073 100644 --- a/tests/Unit/Service/StatusServiceTest.php +++ b/tests/Unit/Service/StatusServiceTest.php @@ -52,22 +52,19 @@ class StatusServiceTest extends TestCase */ public function testGetStatus() { - $this->settings->expects($this->exactly(2)) + $this->settings->expects($this->exactly(3)) ->method('getAppValue') ->withConsecutive( ['news', 'installed_version'], + ['core', 'backgroundjobs_mode'], ['news', 'useCronUpdates'] ) ->will($this->returnValueMap([ ['news', 'installed_version', '', '1.0'], + ['core', 'backgroundjobs_mode', '', 'cron'], ['news', 'useCronUpdates', true, true], ])); - $this->settings->expects($this->exactly(1)) - ->method('getSystemValue') - ->with('backgroundjobs_mode') - ->will($this->returnValue('cron')); - $this->connection->expects($this->exactly(1)) ->method('supports4ByteText') ->will($this->returnValue(true)); @@ -88,22 +85,19 @@ class StatusServiceTest extends TestCase */ public function testGetStatusNoCorrectCronAjax() { - $this->settings->expects($this->exactly(2)) + $this->settings->expects($this->exactly(3)) ->method('getAppValue') ->withConsecutive( ['news', 'installed_version'], + ['core', 'backgroundjobs_mode'], ['news', 'useCronUpdates'] ) ->will($this->returnValueMap([ ['news', 'installed_version', '', '1.0'], + ['core', 'backgroundjobs_mode', '', 'ajax'], ['news', 'useCronUpdates', true, true], ])); - $this->settings->expects($this->exactly(1)) - ->method('getSystemValue') - ->with('backgroundjobs_mode') - ->will($this->returnValue('ajax')); - $this->connection->expects($this->exactly(1)) ->method('supports4ByteText') ->will($this->returnValue(true)); @@ -124,22 +118,19 @@ class StatusServiceTest extends TestCase */ public function testGetStatusNoCorrectCronTurnedOff() { - $this->settings->expects($this->exactly(2)) + $this->settings->expects($this->exactly(3)) ->method('getAppValue') ->withConsecutive( ['news', 'installed_version'], + ['core', 'backgroundjobs_mode'], ['news', 'useCronUpdates'] ) ->will($this->returnValueMap([ ['news', 'installed_version', '', '1.0'], + ['core', 'backgroundjobs_mode', '', 'ajax'], ['news', 'useCronUpdates', true, false], ])); - $this->settings->expects($this->exactly(1)) - ->method('getSystemValue') - ->with('backgroundjobs_mode') - ->will($this->returnValue('ajax')); - $this->connection->expects($this->exactly(1)) ->method('supports4ByteText') ->will($this->returnValue(true)); @@ -160,22 +151,19 @@ class StatusServiceTest extends TestCase */ public function testGetStatusReportsNon4ByteText() { - $this->settings->expects($this->exactly(2)) + $this->settings->expects($this->exactly(3)) ->method('getAppValue') ->withConsecutive( ['news', 'installed_version'], + ['core', 'backgroundjobs_mode'], ['news', 'useCronUpdates'] ) ->will($this->returnValueMap([ ['news', 'installed_version', '', '1.0'], + ['core', 'backgroundjobs_mode', '', 'ajax'], ['news', 'useCronUpdates', true, false], ])); - $this->settings->expects($this->exactly(1)) - ->method('getSystemValue') - ->with('backgroundjobs_mode') - ->will($this->returnValue('ajax')); - $this->connection->expects($this->exactly(1)) ->method('supports4ByteText') ->will($this->returnValue(false)); |