From 7c6c3d0d761f8634d5fa9637d022451b5f17f7bd Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Wed, 11 Jul 2018 15:31:33 +0200 Subject: [PATCH] Fix tests Signed-off-by: Morris Jobke --- settings/Controller/CheckSetupController.php | 6 +++++- tests/Settings/Controller/CheckSetupControllerTest.php | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/settings/Controller/CheckSetupController.php b/settings/Controller/CheckSetupController.php index bd493641bf..b377e36944 100644 --- a/settings/Controller/CheckSetupController.php +++ b/settings/Controller/CheckSetupController.php @@ -525,6 +525,10 @@ Raw output return $this->config->getSystemValue('mail_smtpmode', 'php') === 'php'; } + protected function hasOpcacheLoaded(): bool { + return extension_loaded('opcache'); + } + /** * @return DataResponse */ @@ -553,7 +557,7 @@ Raw output 'hasPassedCodeIntegrityCheck' => $this->checker->hasPassedCheck(), 'codeIntegrityCheckerDocumentation' => $this->urlGenerator->linkToDocs('admin-code-integrity'), 'isOpcacheProperlySetup' => $this->isOpcacheProperlySetup(), - 'hasOpcacheLoaded' => extension_loaded("opcache"), + 'hasOpcacheLoaded' => $this->hasOpcacheLoaded(), 'phpOpcacheDocumentation' => $this->urlGenerator->linkToDocs('admin-php-opcache'), 'isSettimelimitAvailable' => $this->isSettimelimitAvailable(), 'hasFreeTypeSupport' => $this->hasFreeTypeSupport(), diff --git a/tests/Settings/Controller/CheckSetupControllerTest.php b/tests/Settings/Controller/CheckSetupControllerTest.php index 057774a45b..305e2ba22c 100644 --- a/tests/Settings/Controller/CheckSetupControllerTest.php +++ b/tests/Settings/Controller/CheckSetupControllerTest.php @@ -134,6 +134,7 @@ class CheckSetupControllerTest extends TestCase { 'hasMissingIndexes', 'isSqliteUsed', 'isPhpMailerUsed', + 'hasOpcacheLoaded', ])->getMock(); } @@ -395,6 +396,10 @@ class CheckSetupControllerTest extends TestCase { ->expects($this->once()) ->method('hasFileinfoInstalled') ->willReturn(true); + $this->checkSetupController + ->expects($this->once()) + ->method('hasOpcacheLoaded') + ->willReturn(true); $this->checkSetupController ->expects($this->once()) ->method('hasWorkingFileLocking') @@ -451,6 +456,7 @@ class CheckSetupControllerTest extends TestCase { 'hasPassedCodeIntegrityCheck' => true, 'codeIntegrityCheckerDocumentation' => 'http://docs.example.org/server/go.php?to=admin-code-integrity', 'isOpcacheProperlySetup' => false, + 'hasOpcacheLoaded' => true, 'phpOpcacheDocumentation' => 'http://docs.example.org/server/go.php?to=admin-php-opcache', 'isSettimelimitAvailable' => true, 'hasFreeTypeSupport' => false,