Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion settings/Controller/CheckSetupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,16 @@ protected function getLastCronInfo(): array {
];
}

protected function getCronErrors() {
$errors = json_decode($this->config->getAppValue('core', 'cronErrors', ''), true);

if (is_array($errors)) {
return $errors;
}

return [];
}

/**
* @return DataResponse
*/
Expand All @@ -527,7 +537,7 @@ public function check() {
'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'),
Expand Down
10 changes: 7 additions & 3 deletions tests/Settings/Controller/CheckSetupControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -392,6 +392,10 @@ public function testCheck() {
'relativeTime' => '2 hours ago',
'backgroundJobsUrl' => 'https://example.org',
]);
$this->checker
->expects($this->once())
->method('hasPassedCheck')
->willReturn(true);

$expected = new DataResponse(
[
Expand All @@ -407,7 +411,7 @@ public function testCheck() {
'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',
Expand All @@ -421,7 +425,7 @@ public function testCheck() {
'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',
Expand Down