diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-07-11 15:31:33 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2018-07-11 16:08:41 +0200 |
commit | 7c6c3d0d761f8634d5fa9637d022451b5f17f7bd (patch) | |
tree | f6a4f34b86b1a6fe6242eb1eececbc153a470a3b | |
parent | f6f49c77f7d013e5713c964d4d7e3d4b4eedc636 (diff) | |
download | nextcloud-server-7c6c3d0d761f8634d5fa9637d022451b5f17f7bd.tar.gz nextcloud-server-7c6c3d0d761f8634d5fa9637d022451b5f17f7bd.zip |
Fix tests
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
-rw-r--r-- | settings/Controller/CheckSetupController.php | 6 | ||||
-rw-r--r-- | tests/Settings/Controller/CheckSetupControllerTest.php | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/settings/Controller/CheckSetupController.php b/settings/Controller/CheckSetupController.php index bd493641bf6..b377e36944d 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 057774a45ba..305e2ba22ce 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(); } @@ -397,6 +398,10 @@ class CheckSetupControllerTest extends TestCase { ->willReturn(true); $this->checkSetupController ->expects($this->once()) + ->method('hasOpcacheLoaded') + ->willReturn(true); + $this->checkSetupController + ->expects($this->once()) ->method('hasWorkingFileLocking') ->willReturn(true); $this->checkSetupController @@ -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, |