diff --git a/settings/Controller/CheckSetupController.php b/settings/Controller/CheckSetupController.php index f83d0966edab74372222a908c3a22b30dc560dfa..ecbb9839c75b105c1c8d837b40a66df5f0d6d894 100644 --- a/settings/Controller/CheckSetupController.php +++ b/settings/Controller/CheckSetupController.php @@ -513,6 +513,16 @@ Raw output ]; } + protected function getCronErrors() { + $errors = json_decode($this->config->getAppValue('core', 'cronErrors', ''), true); + + if (is_array($errors)) { + return $errors; + } + + return []; + } + /** * @return DataResponse */ @@ -527,7 +537,7 @@ Raw output 'hasWorkingFileLocking' => $this->hasWorkingFileLocking(), 'suggestedOverwriteCliURL' => $this->getSuggestedOverwriteCliURL(), 'cronInfo' => $this->getLastCronInfo(), - 'cronErrors' => json_decode($this->config->getAppValue('core', 'cronErrors', ''), true), + 'cronErrors' => $this->getCronErrors(), 'serverHasInternetConnection' => $this->isInternetConnectionWorking(), 'isMemcacheConfigured' => $this->isMemcacheConfigured(), 'memcacheDocs' => $this->urlGenerator->linkToDocs('admin-performance'), diff --git a/tests/Settings/Controller/CheckSetupControllerTest.php b/tests/Settings/Controller/CheckSetupControllerTest.php index c062dff0704366db6c2acfaf705bfc17b38a6169..470bc9cde641cb2448db2360f7c34f163acc743f 100644 --- a/tests/Settings/Controller/CheckSetupControllerTest.php +++ b/tests/Settings/Controller/CheckSetupControllerTest.php @@ -63,7 +63,7 @@ class CheckSetupControllerTest extends TestCase { private $l10n; /** @var ILogger */ private $logger; - /** @var Checker | \PHPUnit_Framework_MockObject_MockObject */ + /** @var Checker|\PHPUnit_Framework_MockObject_MockObject */ private $checker; /** @var EventDispatcher|\PHPUnit_Framework_MockObject_MockObject */ private $dispatcher; @@ -392,6 +392,10 @@ class CheckSetupControllerTest extends TestCase { 'relativeTime' => '2 hours ago', 'backgroundJobsUrl' => 'https://example.org', ]); + $this->checker + ->expects($this->once()) + ->method('hasPassedCheck') + ->willReturn(true); $expected = new DataResponse( [ @@ -407,7 +411,7 @@ class CheckSetupControllerTest extends TestCase { 'relativeTime' => '2 hours ago', 'backgroundJobsUrl' => 'https://example.org', ], - 'cronErrors' => '', + 'cronErrors' => [], 'serverHasInternetConnection' => false, 'isMemcacheConfigured' => true, 'memcacheDocs' => 'http://docs.example.org/server/go.php?to=admin-performance', @@ -421,7 +425,7 @@ class CheckSetupControllerTest extends TestCase { 'forwardedForHeadersWorking' => true, 'reverseProxyDocs' => 'reverse-proxy-doc-link', 'isCorrectMemcachedPHPModuleInstalled' => true, - 'hasPassedCodeIntegrityCheck' => null, + 'hasPassedCodeIntegrityCheck' => true, 'codeIntegrityCheckerDocumentation' => 'http://docs.example.org/server/go.php?to=admin-code-integrity', 'isOpcacheProperlySetup' => false, 'phpOpcacheDocumentation' => 'http://docs.example.org/server/go.php?to=admin-php-opcache',