From 4fffe42eb9064373cbdedd90f1c4dc3e9fa82c29 Mon Sep 17 00:00:00 2001 From: anoy Date: Fri, 2 Oct 2020 14:34:46 +0200 Subject: fix incorrect cron recommendation Signed-off-by: anoy --- tests/Unit/Service/StatusServiceTest.php | 36 +++++++++++--------------------- 1 file changed, 12 insertions(+), 24 deletions(-) (limited to 'tests') 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)); -- cgit v1.2.3