Hopefully this fixes the tests again

This commit is contained in:
Michael 2018-12-22 22:04:47 +00:00
parent 439afc89b6
commit 732308ce6d
2 changed files with 18 additions and 7 deletions

View File

@ -405,13 +405,6 @@ class Installer
); );
$returnVal = $returnVal ? $status : false; $returnVal = $returnVal ? $status : false;
$status = $this->checkFunction('json_encode',
L10n::t('JSON PHP module'),
L10n::t('Error: JSON PHP module required but not installed.'),
true
);
$returnVal = $returnVal ? $status : false;
$status = $this->checkFunction('imagecreatefromjpeg', $status = $this->checkFunction('imagecreatefromjpeg',
L10n::t('GD graphics PHP module'), L10n::t('GD graphics PHP module'),
L10n::t('Error: GD graphics PHP module with JPEG support required but not installed.'), L10n::t('Error: GD graphics PHP module with JPEG support required but not installed.'),
@ -447,6 +440,13 @@ class Installer
); );
$returnVal = $returnVal ? $status : false; $returnVal = $returnVal ? $status : false;
$status = $this->checkFunction('json_encode',
L10n::t('JSON PHP module'),
L10n::t('Error: JSON PHP module required but not installed.'),
true
);
$returnVal = $returnVal ? $status : false;
return $returnVal; return $returnVal;
} }

View File

@ -177,6 +177,17 @@ class InstallerTest extends MockedTest
true, true,
$install->getChecks()); $install->getChecks());
$this->mockFunctionL10TCalls();
$this->setFunctions(['json_encode' => false]);
$install = new Installer();
$this->assertFalse($install->checkFunctions());
$this->assertCheckExist(9,
'JSON PHP module',
'Error: JSON PHP module required but not installed.',
false,
true,
$install->getChecks());
$this->mockFunctionL10TCalls(); $this->mockFunctionL10TCalls();
$this->setFunctions([ $this->setFunctions([
'curl_init' => true, 'curl_init' => true,