Fix tests

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2018-07-11 15:31:33 +02:00
parent f6f49c77f7
commit 7c6c3d0d76
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
2 changed files with 11 additions and 1 deletions

View File

@ -525,6 +525,10 @@ Raw output
return $this->config->getSystemValue('mail_smtpmode', 'php') === 'php'; return $this->config->getSystemValue('mail_smtpmode', 'php') === 'php';
} }
protected function hasOpcacheLoaded(): bool {
return extension_loaded('opcache');
}
/** /**
* @return DataResponse * @return DataResponse
*/ */
@ -553,7 +557,7 @@ Raw output
'hasPassedCodeIntegrityCheck' => $this->checker->hasPassedCheck(), 'hasPassedCodeIntegrityCheck' => $this->checker->hasPassedCheck(),
'codeIntegrityCheckerDocumentation' => $this->urlGenerator->linkToDocs('admin-code-integrity'), 'codeIntegrityCheckerDocumentation' => $this->urlGenerator->linkToDocs('admin-code-integrity'),
'isOpcacheProperlySetup' => $this->isOpcacheProperlySetup(), 'isOpcacheProperlySetup' => $this->isOpcacheProperlySetup(),
'hasOpcacheLoaded' => extension_loaded("opcache"), 'hasOpcacheLoaded' => $this->hasOpcacheLoaded(),
'phpOpcacheDocumentation' => $this->urlGenerator->linkToDocs('admin-php-opcache'), 'phpOpcacheDocumentation' => $this->urlGenerator->linkToDocs('admin-php-opcache'),
'isSettimelimitAvailable' => $this->isSettimelimitAvailable(), 'isSettimelimitAvailable' => $this->isSettimelimitAvailable(),
'hasFreeTypeSupport' => $this->hasFreeTypeSupport(), 'hasFreeTypeSupport' => $this->hasFreeTypeSupport(),

View File

@ -134,6 +134,7 @@ class CheckSetupControllerTest extends TestCase {
'hasMissingIndexes', 'hasMissingIndexes',
'isSqliteUsed', 'isSqliteUsed',
'isPhpMailerUsed', 'isPhpMailerUsed',
'hasOpcacheLoaded',
])->getMock(); ])->getMock();
} }
@ -395,6 +396,10 @@ class CheckSetupControllerTest extends TestCase {
->expects($this->once()) ->expects($this->once())
->method('hasFileinfoInstalled') ->method('hasFileinfoInstalled')
->willReturn(true); ->willReturn(true);
$this->checkSetupController
->expects($this->once())
->method('hasOpcacheLoaded')
->willReturn(true);
$this->checkSetupController $this->checkSetupController
->expects($this->once()) ->expects($this->once())
->method('hasWorkingFileLocking') ->method('hasWorkingFileLocking')
@ -451,6 +456,7 @@ class CheckSetupControllerTest extends TestCase {
'hasPassedCodeIntegrityCheck' => true, 'hasPassedCodeIntegrityCheck' => true,
'codeIntegrityCheckerDocumentation' => 'http://docs.example.org/server/go.php?to=admin-code-integrity', 'codeIntegrityCheckerDocumentation' => 'http://docs.example.org/server/go.php?to=admin-code-integrity',
'isOpcacheProperlySetup' => false, 'isOpcacheProperlySetup' => false,
'hasOpcacheLoaded' => true,
'phpOpcacheDocumentation' => 'http://docs.example.org/server/go.php?to=admin-php-opcache', 'phpOpcacheDocumentation' => 'http://docs.example.org/server/go.php?to=admin-php-opcache',
'isSettimelimitAvailable' => true, 'isSettimelimitAvailable' => true,
'hasFreeTypeSupport' => false, 'hasFreeTypeSupport' => false,