]> git.mxchange.org Git - friendica.git/blobdiff - tests/src/Core/InstallerTest.php
Merge pull request #6315 from MrPetovan/bug/6309-add-fulltext-index-profile
[friendica.git] / tests / src / Core / InstallerTest.php
index b15b91e14c6bde0969d1c83ebb610a95f059940f..564c2562a877ca37c8f1db3700a565b958b5cc52 100644 (file)
@@ -43,6 +43,8 @@ class InstallerTest extends MockedTest
                $this->mockL10nT('Error: iconv PHP module required but not installed.', 1);
                $this->mockL10nT('POSIX PHP module', 1);
                $this->mockL10nT('Error: POSIX PHP module required but not installed.', 1);
+               $this->mockL10nT('JSON PHP module', 1);
+               $this->mockL10nT('Error: JSON PHP module required but not installed.', 1);
        }
 
        private function assertCheckExist($position, $title, $help, $status, $required, $assertionArray)
@@ -177,6 +179,17 @@ class InstallerTest extends MockedTest
                        true,
                        $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->setFunctions([
                        'curl_init' => true,
@@ -184,7 +197,8 @@ class InstallerTest extends MockedTest
                        'openssl_public_encrypt' => true,
                        'mb_strlen' => true,
                        'iconv_strlen' => true,
-                       'posix_kill' => true
+                       'posix_kill' => true,
+                       'json_encode' => true
                ]);
                $install = new Installer();
                $this->assertTrue($install->checkFunctions());