diff --git a/test/classes/AbstractTestCase.php b/test/classes/AbstractTestCase.php index e2c45e18ed..581c26b9c7 100644 --- a/test/classes/AbstractTestCase.php +++ b/test/classes/AbstractTestCase.php @@ -125,6 +125,11 @@ abstract class AbstractTestCase extends TestCase // phpcs:enable } + protected function setUpEnv(): void + { + require ROOT_PATH . 'test/bootstrap-dist.php'; + } + /** * Desctroys the environment built for the test. * Clean all variables diff --git a/test/classes/AdvisorTest.php b/test/classes/AdvisorTest.php index c906bf4b17..506d0abeb4 100644 --- a/test/classes/AdvisorTest.php +++ b/test/classes/AdvisorTest.php @@ -147,6 +147,8 @@ class AdvisorTest extends PmaTestCase */ public function testAddRule($rule, $expected, $error): void { + parent::loadDefaultConfig(); + parent::setLanguage(); $advisor = new Advisor($GLOBALS['dbi'], new ExpressionLanguage()); $parseResult = $advisor->parseRulesFile(Advisor::GENERIC_RULES_FILE); $this->assertEquals($parseResult['errors'], []); diff --git a/test/classes/CharsetsTest.php b/test/classes/CharsetsTest.php index 96a60b0687..58e3218458 100644 --- a/test/classes/CharsetsTest.php +++ b/test/classes/CharsetsTest.php @@ -17,6 +17,7 @@ class CharsetsTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + parent::setUpEnv(); $GLOBALS['cfg']['DBG']['sql'] = false; $GLOBALS['cfg']['Server']['DisableIS'] = false; } diff --git a/test/classes/Config/ConfigFileTest.php b/test/classes/Config/ConfigFileTest.php index 195f1475cf..580a296678 100644 --- a/test/classes/Config/ConfigFileTest.php +++ b/test/classes/Config/ConfigFileTest.php @@ -39,6 +39,7 @@ class ConfigFileTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 1; $this->object = new ConfigFile(); } diff --git a/test/classes/Config/FormDisplayTemplateTest.php b/test/classes/Config/FormDisplayTemplateTest.php index 991f87ad68..e795886db5 100644 --- a/test/classes/Config/FormDisplayTemplateTest.php +++ b/test/classes/Config/FormDisplayTemplateTest.php @@ -27,6 +27,7 @@ class FormDisplayTemplateTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + parent::setLanguage(); $this->config = new Config(); $this->formDisplayTemplate = new FormDisplayTemplate($this->config); } diff --git a/test/classes/Config/FormDisplayTest.php b/test/classes/Config/FormDisplayTest.php index f940f7a32a..a6ee589708 100644 --- a/test/classes/Config/FormDisplayTest.php +++ b/test/classes/Config/FormDisplayTest.php @@ -31,6 +31,8 @@ class FormDisplayTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::setTheme(); + parent::loadDefaultConfig(); $GLOBALS['pmaThemePath'] = $GLOBALS['PMA_Theme']->getPath(); $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['server'] = 0; diff --git a/test/classes/Config/FormTest.php b/test/classes/Config/FormTest.php index 916d6cdb6c..0a60328cba 100644 --- a/test/classes/Config/FormTest.php +++ b/test/classes/Config/FormTest.php @@ -29,6 +29,8 @@ class FormTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::setTheme(); + parent::loadDefaultConfig(); $GLOBALS['pmaThemePath'] = $GLOBALS['PMA_Theme']->getPath(); $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['server'] = 0; diff --git a/test/classes/Config/Forms/FormListTest.php b/test/classes/Config/Forms/FormListTest.php index 6e001fa8c7..cb834e1ecc 100644 --- a/test/classes/Config/Forms/FormListTest.php +++ b/test/classes/Config/Forms/FormListTest.php @@ -18,6 +18,7 @@ class FormListTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['server'] = 1; } diff --git a/test/classes/Config/PageSettingsTest.php b/test/classes/Config/PageSettingsTest.php index 57ded8f944..563ac8b214 100644 --- a/test/classes/Config/PageSettingsTest.php +++ b/test/classes/Config/PageSettingsTest.php @@ -21,6 +21,7 @@ class PageSettingsTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::setLanguage(); $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['PMA_Config']->enableBc(); $GLOBALS['server'] = 1; diff --git a/test/classes/ConfigTest.php b/test/classes/ConfigTest.php index 7e793b33ee..46fe4d95c7 100644 --- a/test/classes/ConfigTest.php +++ b/test/classes/ConfigTest.php @@ -56,6 +56,7 @@ class ConfigTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::setTheme(); $_SERVER['HTTP_USER_AGENT'] = ''; $this->object = new Config(); $GLOBALS['server'] = 0; diff --git a/test/classes/Controllers/Database/PrivilegesControllerTest.php b/test/classes/Controllers/Database/PrivilegesControllerTest.php index bbf5cbeda8..62c2df157d 100644 --- a/test/classes/Controllers/Database/PrivilegesControllerTest.php +++ b/test/classes/Controllers/Database/PrivilegesControllerTest.php @@ -12,6 +12,16 @@ use PhpMyAdmin\Url; class PrivilegesControllerTest extends PmaTestCase { + /** + * Configures global environment. + */ + protected function setUp(): void + { + parent::setUp(); + parent::loadDefaultConfig(); + parent::setLanguage(); + } + public function testIndex(): void { global $dbi, $db, $server, $cfg, $PMA_PHP_SELF, $is_grantuser, $is_createuser; diff --git a/test/classes/Controllers/Database/StructureControllerTest.php b/test/classes/Controllers/Database/StructureControllerTest.php index d11e77844f..ec843dcfe1 100644 --- a/test/classes/Controllers/Database/StructureControllerTest.php +++ b/test/classes/Controllers/Database/StructureControllerTest.php @@ -61,6 +61,8 @@ class StructureControllerTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); + $GLOBALS['text_dir'] = 'ltr'; $GLOBALS['server'] = 1; $GLOBALS['cfg']['Server']['DisableIS'] = false; $GLOBALS['table'] = 'table'; diff --git a/test/classes/Controllers/Server/BinlogControllerTest.php b/test/classes/Controllers/Server/BinlogControllerTest.php index 57aaa46f3b..c0c3df0018 100644 --- a/test/classes/Controllers/Server/BinlogControllerTest.php +++ b/test/classes/Controllers/Server/BinlogControllerTest.php @@ -26,6 +26,7 @@ class BinlogControllerTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + $GLOBALS['text_dir'] = 'ltr'; $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['PMA_Config']->enableBc(); diff --git a/test/classes/Controllers/Server/EnginesControllerTest.php b/test/classes/Controllers/Server/EnginesControllerTest.php index 8e402d9fd8..4434715672 100644 --- a/test/classes/Controllers/Server/EnginesControllerTest.php +++ b/test/classes/Controllers/Server/EnginesControllerTest.php @@ -26,6 +26,7 @@ class EnginesControllerTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + $GLOBALS['text_dir'] = 'ltr'; $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['PMA_Config']->enableBc(); diff --git a/test/classes/Controllers/Server/PluginsControllerTest.php b/test/classes/Controllers/Server/PluginsControllerTest.php index da39415779..a99f3dfae6 100644 --- a/test/classes/Controllers/Server/PluginsControllerTest.php +++ b/test/classes/Controllers/Server/PluginsControllerTest.php @@ -25,6 +25,7 @@ class PluginsControllerTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + $GLOBALS['text_dir'] = 'ltr'; $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['PMA_Config']->enableBc(); diff --git a/test/classes/Controllers/Server/Status/AdvisorControllerTest.php b/test/classes/Controllers/Server/Status/AdvisorControllerTest.php index 6d35e86964..fc880dbb87 100644 --- a/test/classes/Controllers/Server/Status/AdvisorControllerTest.php +++ b/test/classes/Controllers/Server/Status/AdvisorControllerTest.php @@ -31,6 +31,7 @@ class AdvisorControllerTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + $GLOBALS['text_dir'] = 'ltr'; $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['PMA_Config']->enableBc(); diff --git a/test/classes/Controllers/Server/Status/MonitorControllerTest.php b/test/classes/Controllers/Server/Status/MonitorControllerTest.php index cc3279bba5..6c38bc45c0 100644 --- a/test/classes/Controllers/Server/Status/MonitorControllerTest.php +++ b/test/classes/Controllers/Server/Status/MonitorControllerTest.php @@ -23,6 +23,7 @@ class MonitorControllerTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + $GLOBALS['text_dir'] = 'ltr'; $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['PMA_Config']->enableBc(); diff --git a/test/classes/Controllers/Server/Status/ProcessesControllerTest.php b/test/classes/Controllers/Server/Status/ProcessesControllerTest.php index 5a890416dc..6b43e47255 100644 --- a/test/classes/Controllers/Server/Status/ProcessesControllerTest.php +++ b/test/classes/Controllers/Server/Status/ProcessesControllerTest.php @@ -24,6 +24,7 @@ class ProcessesControllerTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + $GLOBALS['text_dir'] = 'ltr'; $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['PMA_Config']->enableBc(); diff --git a/test/classes/Controllers/Server/Status/QueriesControllerTest.php b/test/classes/Controllers/Server/Status/QueriesControllerTest.php index 438ab61b7e..c6fea58763 100644 --- a/test/classes/Controllers/Server/Status/QueriesControllerTest.php +++ b/test/classes/Controllers/Server/Status/QueriesControllerTest.php @@ -25,6 +25,7 @@ class QueriesControllerTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + $GLOBALS['text_dir'] = 'ltr'; $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['PMA_Config']->enableBc(); diff --git a/test/classes/Controllers/Server/Status/StatusControllerTest.php b/test/classes/Controllers/Server/Status/StatusControllerTest.php index bced1c2aed..019d057559 100644 --- a/test/classes/Controllers/Server/Status/StatusControllerTest.php +++ b/test/classes/Controllers/Server/Status/StatusControllerTest.php @@ -21,6 +21,7 @@ class StatusControllerTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + $GLOBALS['text_dir'] = 'ltr'; $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['PMA_Config']->enableBc(); diff --git a/test/classes/Controllers/Server/Status/VariablesControllerTest.php b/test/classes/Controllers/Server/Status/VariablesControllerTest.php index 6f94026c92..638dd277e9 100644 --- a/test/classes/Controllers/Server/Status/VariablesControllerTest.php +++ b/test/classes/Controllers/Server/Status/VariablesControllerTest.php @@ -25,6 +25,7 @@ class VariablesControllerTest extends AbstractTestCase $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['PMA_Config']->enableBc(); + $GLOBALS['text_dir'] = 'ltr'; $GLOBALS['server'] = 1; $GLOBALS['db'] = 'db'; $GLOBALS['table'] = 'table'; diff --git a/test/classes/Controllers/Server/VariablesControllerTest.php b/test/classes/Controllers/Server/VariablesControllerTest.php index d1846b4842..ee08d8388f 100644 --- a/test/classes/Controllers/Server/VariablesControllerTest.php +++ b/test/classes/Controllers/Server/VariablesControllerTest.php @@ -31,6 +31,7 @@ class VariablesControllerTest extends AbstractTestCase $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['PMA_Config']->enableBc(); + $GLOBALS['text_dir'] = 'ltr'; $GLOBALS['server'] = 1; $GLOBALS['db'] = 'db'; $GLOBALS['table'] = 'table'; diff --git a/test/classes/Controllers/Table/IndexesControllerTest.php b/test/classes/Controllers/Table/IndexesControllerTest.php index c704a3e34d..be9a531069 100644 --- a/test/classes/Controllers/Table/IndexesControllerTest.php +++ b/test/classes/Controllers/Table/IndexesControllerTest.php @@ -33,12 +33,15 @@ class IndexesControllerTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); + /** * SET these to avoid undefined index error */ $GLOBALS['server'] = 1; $GLOBALS['db'] = 'db'; $GLOBALS['table'] = 'table'; + $GLOBALS['text_dir'] = 'ltr'; $GLOBALS['PMA_PHP_SELF'] = 'index.php'; $GLOBALS['cfg']['Server']['pmadb'] = ''; $GLOBALS['cfg']['Server']['DisableIS'] = false; diff --git a/test/classes/Controllers/Table/PrivilegesControllerTest.php b/test/classes/Controllers/Table/PrivilegesControllerTest.php index 938c5acfcc..175d5729ca 100644 --- a/test/classes/Controllers/Table/PrivilegesControllerTest.php +++ b/test/classes/Controllers/Table/PrivilegesControllerTest.php @@ -12,8 +12,19 @@ use PhpMyAdmin\Url; class PrivilegesControllerTest extends PmaTestCase { + + /** + * Configures global environment. + */ + protected function setUp(): void + { + parent::setUp(); + parent::loadDefaultConfig(); + } + public function testIndex(): void { + global $dbi, $db, $table, $server, $cfg, $PMA_PHP_SELF, $is_grantuser, $is_createuser; $db = 'db'; diff --git a/test/classes/Controllers/Table/RelationControllerTest.php b/test/classes/Controllers/Table/RelationControllerTest.php index 331c09ff57..a1b02e9e4b 100644 --- a/test/classes/Controllers/Table/RelationControllerTest.php +++ b/test/classes/Controllers/Table/RelationControllerTest.php @@ -32,9 +32,12 @@ class RelationControllerTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); + $GLOBALS['server'] = 0; $GLOBALS['db'] = 'db'; $GLOBALS['table'] = 'table'; + $GLOBALS['text_dir'] = 'ltr'; $GLOBALS['PMA_PHP_SELF'] = 'index.php'; $GLOBALS['cfg']['Server']['DisableIS'] = false; //$_SESSION diff --git a/test/classes/Controllers/Table/SearchControllerTest.php b/test/classes/Controllers/Table/SearchControllerTest.php index bd7a37e7b7..d01916e44a 100644 --- a/test/classes/Controllers/Table/SearchControllerTest.php +++ b/test/classes/Controllers/Table/SearchControllerTest.php @@ -35,6 +35,8 @@ class SearchControllerTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); + /** * SET these to avoid undefined index error */ @@ -43,6 +45,7 @@ class SearchControllerTest extends PmaTestCase $GLOBALS['server'] = 1; $GLOBALS['db'] = 'PMA'; $GLOBALS['table'] = 'PMA_BookMark'; + $GLOBALS['text_dir'] = 'ltr'; $GLOBALS['PMA_PHP_SELF'] = 'index.php'; $relation = new Relation($GLOBALS['dbi']); $GLOBALS['cfgRelation'] = $relation->getRelationsParam(); diff --git a/test/classes/Controllers/Table/StructureControllerTest.php b/test/classes/Controllers/Table/StructureControllerTest.php index 3d473c0522..541c0861f4 100644 --- a/test/classes/Controllers/Table/StructureControllerTest.php +++ b/test/classes/Controllers/Table/StructureControllerTest.php @@ -39,6 +39,8 @@ class StructureControllerTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); + $GLOBALS['text_dir'] = 'ltr'; $GLOBALS['server'] = 1; $GLOBALS['db'] = 'db'; $GLOBALS['table'] = 'table'; diff --git a/test/classes/Controllers/TransformationOverviewControllerTest.php b/test/classes/Controllers/TransformationOverviewControllerTest.php index a9e0b9ff28..e422dccaeb 100644 --- a/test/classes/Controllers/TransformationOverviewControllerTest.php +++ b/test/classes/Controllers/TransformationOverviewControllerTest.php @@ -24,6 +24,7 @@ class TransformationOverviewControllerTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + $GLOBALS['text_dir'] = 'ltr'; $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['PMA_Config']->enableBc(); diff --git a/test/classes/CoreTest.php b/test/classes/CoreTest.php index 1abeba0fc9..27e11ec653 100644 --- a/test/classes/CoreTest.php +++ b/test/classes/CoreTest.php @@ -30,6 +30,8 @@ class CoreTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); + $GLOBALS['server'] = 0; $GLOBALS['db'] = ''; $GLOBALS['table'] = ''; diff --git a/test/classes/CreateAddFieldTest.php b/test/classes/CreateAddFieldTest.php index 5bf4a3265f..7177afe7c3 100644 --- a/test/classes/CreateAddFieldTest.php +++ b/test/classes/CreateAddFieldTest.php @@ -23,6 +23,7 @@ class CreateAddFieldTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + parent::setUpEnv(); $this->createAddField = new CreateAddField($GLOBALS['dbi']); } diff --git a/test/classes/Database/QbeTest.php b/test/classes/Database/QbeTest.php index cd7ed9bb3a..38f8cb2e5c 100644 --- a/test/classes/Database/QbeTest.php +++ b/test/classes/Database/QbeTest.php @@ -30,6 +30,7 @@ class QbeTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::setUpEnv(); $GLOBALS['server'] = 0; $GLOBALS['db'] = 'pma_test'; $this->object = new Qbe(new Relation($GLOBALS['dbi']), new Template(), $GLOBALS['dbi'], 'pma_test'); diff --git a/test/classes/Database/RoutinesTest.php b/test/classes/Database/RoutinesTest.php index 71ad528c5d..7521d1710f 100644 --- a/test/classes/Database/RoutinesTest.php +++ b/test/classes/Database/RoutinesTest.php @@ -23,6 +23,7 @@ class RoutinesTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + parent::setUpEnv(); $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['PMA_Config']->enableBc(); $GLOBALS['cfg']['Server']['DisableIS'] = false; @@ -31,6 +32,7 @@ class RoutinesTest extends AbstractTestCase $GLOBALS['db'] = 'db'; $GLOBALS['table'] = 'table'; $GLOBALS['PMA_PHP_SELF'] = 'index.php'; + $GLOBALS['text_dir'] = 'ltr'; $this->routines = new Routines( $GLOBALS['dbi'], diff --git a/test/classes/Database/SearchTest.php b/test/classes/Database/SearchTest.php index d7c0685faf..08c2527fcf 100644 --- a/test/classes/Database/SearchTest.php +++ b/test/classes/Database/SearchTest.php @@ -29,6 +29,8 @@ class SearchTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); + $GLOBALS['server'] = 0; $GLOBALS['db'] = 'pma'; $GLOBALS['_POST'] = []; diff --git a/test/classes/Database/TriggersTest.php b/test/classes/Database/TriggersTest.php index 73c4c9104e..113a9cc659 100644 --- a/test/classes/Database/TriggersTest.php +++ b/test/classes/Database/TriggersTest.php @@ -21,6 +21,7 @@ class TriggersTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + parent::setUpEnv(); $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['PMA_Config']->enableBc(); $GLOBALS['cfg']['Server']['DisableIS'] = false; diff --git a/test/classes/DatabaseInterfaceTest.php b/test/classes/DatabaseInterfaceTest.php index 3e08b01787..734e1cd78b 100644 --- a/test/classes/DatabaseInterfaceTest.php +++ b/test/classes/DatabaseInterfaceTest.php @@ -27,6 +27,7 @@ class DatabaseInterfaceTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; $extension = new DbiDummy(); $this->_dbi = new DatabaseInterface($extension); diff --git a/test/classes/Display/ExportTest.php b/test/classes/Display/ExportTest.php index b4f36bf363..4493f938ed 100644 --- a/test/classes/Display/ExportTest.php +++ b/test/classes/Display/ExportTest.php @@ -29,6 +29,7 @@ class ExportTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + parent::setLanguage(); $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['PMA_Config']->enableBc(); $GLOBALS['cfg']['Server']['host'] = 'localhost'; diff --git a/test/classes/Display/ResultsTest.php b/test/classes/Display/ResultsTest.php index bc566f9578..82e754a098 100644 --- a/test/classes/Display/ResultsTest.php +++ b/test/classes/Display/ResultsTest.php @@ -37,6 +37,7 @@ class ResultsTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::setLanguage(); $GLOBALS['server'] = 0; $GLOBALS['db'] = 'db'; $GLOBALS['table'] = 'table'; diff --git a/test/classes/Engines/InnodbTest.php b/test/classes/Engines/InnodbTest.php index 0cc9bc8517..26152db62e 100644 --- a/test/classes/Engines/InnodbTest.php +++ b/test/classes/Engines/InnodbTest.php @@ -26,6 +26,7 @@ class InnodbTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::setUpEnv(); $GLOBALS['server'] = 0; $this->object = new Innodb('innodb'); } diff --git a/test/classes/Engines/PbxtTest.php b/test/classes/Engines/PbxtTest.php index 4440ba7b1b..3ee36cb3bd 100644 --- a/test/classes/Engines/PbxtTest.php +++ b/test/classes/Engines/PbxtTest.php @@ -28,6 +28,8 @@ class PbxtTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); + $GLOBALS['server'] = 0; $this->object = new Pbxt('pbxt'); } diff --git a/test/classes/ErrorHandlerTest.php b/test/classes/ErrorHandlerTest.php index c249a4924e..53dfb063ee 100644 --- a/test/classes/ErrorHandlerTest.php +++ b/test/classes/ErrorHandlerTest.php @@ -30,8 +30,11 @@ class ErrorHandlerTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $this->object = new ErrorHandler(); + $_SESSION['errors'] = []; $GLOBALS['server'] = 0; + $GLOBALS['cfg']['SendErrorReports'] = 'always'; } /** @@ -167,7 +170,6 @@ class ErrorHandlerTest extends PmaTestCase */ public function testCheckSavedErrors() { - $_SESSION['errors'] = []; $this->_callProtectedFunction( 'checkSavedErrors', diff --git a/test/classes/FileTest.php b/test/classes/FileTest.php index 0a1079dc9a..5e59aafbd1 100644 --- a/test/classes/FileTest.php +++ b/test/classes/FileTest.php @@ -21,6 +21,7 @@ class FileTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['charset_conversion'] = false; } diff --git a/test/classes/FilesTest.php b/test/classes/FilesTest.php index 1665ac9ac1..058069589f 100644 --- a/test/classes/FilesTest.php +++ b/test/classes/FilesTest.php @@ -14,6 +14,15 @@ use PhpMyAdmin\Tests\AbstractTestCase; */ class FilesTest extends AbstractTestCase { + /** + * Setup function for test cases + */ + protected function setUp(): void + { + parent::setUp(); + parent::setTheme(); + } + /** * Test for dynamic javascript files * diff --git a/test/classes/FooterTest.php b/test/classes/FooterTest.php index 5105b1851f..5a372a5159 100644 --- a/test/classes/FooterTest.php +++ b/test/classes/FooterTest.php @@ -32,6 +32,7 @@ class FooterTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::setLanguage(); $_SERVER['SCRIPT_NAME'] = 'index.php'; $GLOBALS['PMA_PHP_SELF'] = 'index.php'; $GLOBALS['db'] = ''; diff --git a/test/classes/GitTest.php b/test/classes/GitTest.php index b609e3da77..18dd8f33f3 100644 --- a/test/classes/GitTest.php +++ b/test/classes/GitTest.php @@ -38,6 +38,7 @@ class GitTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::setProxySettings(); $this->config = new Config(CONFIG_FILE); $this->object = new Git($this->config); } diff --git a/test/classes/HeaderTest.php b/test/classes/HeaderTest.php index 68cba7eadc..f86fcb87e1 100644 --- a/test/classes/HeaderTest.php +++ b/test/classes/HeaderTest.php @@ -26,6 +26,8 @@ class HeaderTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::setTheme(); + parent::setLanguage(); if (! defined('PMA_IS_WINDOWS')) { define('PMA_IS_WINDOWS', false); } diff --git a/test/classes/Html/GeneratorTest.php b/test/classes/Html/GeneratorTest.php index 8b64aea188..e731d239f0 100644 --- a/test/classes/Html/GeneratorTest.php +++ b/test/classes/Html/GeneratorTest.php @@ -18,6 +18,17 @@ use function urlencode; */ class GeneratorTest extends PmaTestCase { + + /** + * Set up the test. + */ + protected function setUp(): void + { + parent::setUp(); + parent::loadDefaultConfig(); + parent::setLanguage(); + } + /** * Test for getDbLink * diff --git a/test/classes/InsertEditTest.php b/test/classes/InsertEditTest.php index d0b71584c6..6ebb989707 100644 --- a/test/classes/InsertEditTest.php +++ b/test/classes/InsertEditTest.php @@ -37,6 +37,7 @@ class InsertEditTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + parent::setLanguage(); $GLOBALS['server'] = 1; $GLOBALS['PMA_PHP_SELF'] = 'index.php'; $GLOBALS['cfg']['ServerDefault'] = 1; @@ -3489,6 +3490,7 @@ class InsertEditTest extends AbstractTestCase { $extra_data = ['isNeedToRecheck' => true]; + $_POST['where_clause'] = []; $_POST['where_clause'][0] = 1; $dbi = $this->getMockBuilder(DatabaseInterface::class) diff --git a/test/classes/LinterTest.php b/test/classes/LinterTest.php index ba2b07037b..30f2517ca8 100644 --- a/test/classes/LinterTest.php +++ b/test/classes/LinterTest.php @@ -14,6 +14,18 @@ use function str_repeat; */ class LinterTest extends PmaTestCase { + /** + * Sets up the fixture, for example, opens a network connection. + * This method is called before a test is executed. + * + * @access protected + */ + protected function setUp(): void + { + parent::setUp(); + parent::setLanguage(); + } + /** * Test for Linter::getLines * diff --git a/test/classes/MenuTest.php b/test/classes/MenuTest.php index e1d56d98bf..00147a2422 100644 --- a/test/classes/MenuTest.php +++ b/test/classes/MenuTest.php @@ -22,6 +22,9 @@ class MenuTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::setTheme(); + parent::loadDefaultConfig(); + if (! defined('PMA_IS_WINDOWS')) { define('PMA_IS_WINDOWS', false); } diff --git a/test/classes/Navigation/NavigationTest.php b/test/classes/Navigation/NavigationTest.php index e1677c582f..2a8461c612 100644 --- a/test/classes/Navigation/NavigationTest.php +++ b/test/classes/Navigation/NavigationTest.php @@ -29,6 +29,8 @@ class NavigationTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); + parent::setLanguage(); $GLOBALS['server'] = 1; $GLOBALS['db'] = 'db'; $GLOBALS['table'] = ''; diff --git a/test/classes/Navigation/Nodes/NodeColumnContainerTest.php b/test/classes/Navigation/Nodes/NodeColumnContainerTest.php index d637ff3884..ff3431f025 100644 --- a/test/classes/Navigation/Nodes/NodeColumnContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeColumnContainerTest.php @@ -20,6 +20,7 @@ class NodeColumnContainerTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeColumnTest.php b/test/classes/Navigation/Nodes/NodeColumnTest.php index 66583c0f68..78bc0afd57 100644 --- a/test/classes/Navigation/Nodes/NodeColumnTest.php +++ b/test/classes/Navigation/Nodes/NodeColumnTest.php @@ -20,6 +20,7 @@ class NodeColumnTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeDatabaseChildTest.php b/test/classes/Navigation/Nodes/NodeDatabaseChildTest.php index 45afbc091e..c756a39cd5 100644 --- a/test/classes/Navigation/Nodes/NodeDatabaseChildTest.php +++ b/test/classes/Navigation/Nodes/NodeDatabaseChildTest.php @@ -32,6 +32,8 @@ class NodeDatabaseChildTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::setTheme(); + parent::setLanguage(); $GLOBALS['pmaThemePath'] = $GLOBALS['PMA_Theme']->getPath(); $GLOBALS['cfg']['DefaultTabDatabase'] = 'structure'; $GLOBALS['server'] = 1; diff --git a/test/classes/Navigation/Nodes/NodeDatabaseTest.php b/test/classes/Navigation/Nodes/NodeDatabaseTest.php index 4d1654a7b3..2c8cda8fed 100644 --- a/test/classes/Navigation/Nodes/NodeDatabaseTest.php +++ b/test/classes/Navigation/Nodes/NodeDatabaseTest.php @@ -21,6 +21,7 @@ class NodeDatabaseTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; $GLOBALS['cfg']['DefaultTabDatabase'] = 'structure'; $GLOBALS['cfg']['MaxNavigationItems'] = 250; diff --git a/test/classes/Navigation/Nodes/NodeEventContainerTest.php b/test/classes/Navigation/Nodes/NodeEventContainerTest.php index 9cd88a0a54..49f85febed 100644 --- a/test/classes/Navigation/Nodes/NodeEventContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeEventContainerTest.php @@ -21,6 +21,7 @@ class NodeEventContainerTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeEventTest.php b/test/classes/Navigation/Nodes/NodeEventTest.php index cce387e10d..128ad4ef08 100644 --- a/test/classes/Navigation/Nodes/NodeEventTest.php +++ b/test/classes/Navigation/Nodes/NodeEventTest.php @@ -20,6 +20,7 @@ class NodeEventTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeFunctionContainerTest.php b/test/classes/Navigation/Nodes/NodeFunctionContainerTest.php index 504336daca..2488749573 100644 --- a/test/classes/Navigation/Nodes/NodeFunctionContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeFunctionContainerTest.php @@ -20,6 +20,7 @@ class NodeFunctionContainerTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeFunctionTest.php b/test/classes/Navigation/Nodes/NodeFunctionTest.php index fc5a45c72a..d0bda4843d 100644 --- a/test/classes/Navigation/Nodes/NodeFunctionTest.php +++ b/test/classes/Navigation/Nodes/NodeFunctionTest.php @@ -20,6 +20,7 @@ class NodeFunctionTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeIndexContainerTest.php b/test/classes/Navigation/Nodes/NodeIndexContainerTest.php index 14b8bcd5b2..0c7ed7c6ac 100644 --- a/test/classes/Navigation/Nodes/NodeIndexContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeIndexContainerTest.php @@ -20,6 +20,7 @@ class NodeIndexContainerTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeIndexTest.php b/test/classes/Navigation/Nodes/NodeIndexTest.php index decfe1ac67..c35dbd362d 100644 --- a/test/classes/Navigation/Nodes/NodeIndexTest.php +++ b/test/classes/Navigation/Nodes/NodeIndexTest.php @@ -20,6 +20,7 @@ class NodeIndexTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeProcedureContainerTest.php b/test/classes/Navigation/Nodes/NodeProcedureContainerTest.php index 792c5daca9..888762c382 100644 --- a/test/classes/Navigation/Nodes/NodeProcedureContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeProcedureContainerTest.php @@ -20,6 +20,7 @@ class NodeProcedureContainerTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeProcedureTest.php b/test/classes/Navigation/Nodes/NodeProcedureTest.php index 0d9c4e62c1..5c821b9df7 100644 --- a/test/classes/Navigation/Nodes/NodeProcedureTest.php +++ b/test/classes/Navigation/Nodes/NodeProcedureTest.php @@ -20,6 +20,7 @@ class NodeProcedureTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeTableContainerTest.php b/test/classes/Navigation/Nodes/NodeTableContainerTest.php index 2bf5d67c6d..26308e57d7 100644 --- a/test/classes/Navigation/Nodes/NodeTableContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeTableContainerTest.php @@ -20,6 +20,7 @@ class NodeTableContainerTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; $GLOBALS['cfg']['NavigationTreeEnableGrouping'] = true; $GLOBALS['cfg']['NavigationTreeDbSeparator'] = '_'; diff --git a/test/classes/Navigation/Nodes/NodeTableTest.php b/test/classes/Navigation/Nodes/NodeTableTest.php index 8ee67980df..72f18af21f 100644 --- a/test/classes/Navigation/Nodes/NodeTableTest.php +++ b/test/classes/Navigation/Nodes/NodeTableTest.php @@ -20,6 +20,8 @@ class NodeTableTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); + $GLOBALS['server'] = 0; $GLOBALS['cfg']['NavigationTreeDefaultTabTable'] = 'b_browse'; $GLOBALS['cfg']['NavigationTreeDefaultTabTable2'] = ''; diff --git a/test/classes/Navigation/Nodes/NodeTest.php b/test/classes/Navigation/Nodes/NodeTest.php index b49362bc09..acc5c8f060 100644 --- a/test/classes/Navigation/Nodes/NodeTest.php +++ b/test/classes/Navigation/Nodes/NodeTest.php @@ -23,6 +23,7 @@ class NodeTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; $GLOBALS['cfg']['Server']['DisableIS'] = false; } diff --git a/test/classes/Navigation/Nodes/NodeTriggerContainerTest.php b/test/classes/Navigation/Nodes/NodeTriggerContainerTest.php index fd51b50998..e147afbc1c 100644 --- a/test/classes/Navigation/Nodes/NodeTriggerContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeTriggerContainerTest.php @@ -20,6 +20,7 @@ class NodeTriggerContainerTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeTriggerTest.php b/test/classes/Navigation/Nodes/NodeTriggerTest.php index 148bd805f9..8674a7b08e 100644 --- a/test/classes/Navigation/Nodes/NodeTriggerTest.php +++ b/test/classes/Navigation/Nodes/NodeTriggerTest.php @@ -20,6 +20,7 @@ class NodeTriggerTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; } diff --git a/test/classes/Navigation/Nodes/NodeViewContainerTest.php b/test/classes/Navigation/Nodes/NodeViewContainerTest.php index 4daa8eeb3c..ad6f1f4186 100644 --- a/test/classes/Navigation/Nodes/NodeViewContainerTest.php +++ b/test/classes/Navigation/Nodes/NodeViewContainerTest.php @@ -20,6 +20,7 @@ class NodeViewContainerTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; $GLOBALS['cfg']['NavigationTreeEnableGrouping'] = true; $GLOBALS['cfg']['NavigationTreeDbSeparator'] = '_'; diff --git a/test/classes/Navigation/Nodes/NodeViewTest.php b/test/classes/Navigation/Nodes/NodeViewTest.php index be2614ffd9..58e7ff4d54 100644 --- a/test/classes/Navigation/Nodes/NodeViewTest.php +++ b/test/classes/Navigation/Nodes/NodeViewTest.php @@ -21,6 +21,7 @@ class NodeViewTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; } diff --git a/test/classes/Plugins/Auth/AuthenticationConfigTest.php b/test/classes/Plugins/Auth/AuthenticationConfigTest.php index 35af99f247..80ff225ee8 100644 --- a/test/classes/Plugins/Auth/AuthenticationConfigTest.php +++ b/test/classes/Plugins/Auth/AuthenticationConfigTest.php @@ -27,6 +27,7 @@ class AuthenticationConfigTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::setLanguage(); $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['PMA_Config']->enableBc(); $GLOBALS['server'] = 0; diff --git a/test/classes/Plugins/Auth/AuthenticationCookieTest.php b/test/classes/Plugins/Auth/AuthenticationCookieTest.php index c20b72c63b..d004956c1e 100644 --- a/test/classes/Plugins/Auth/AuthenticationCookieTest.php +++ b/test/classes/Plugins/Auth/AuthenticationCookieTest.php @@ -38,6 +38,8 @@ class AuthenticationCookieTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::setLanguage(); + parent::setTheme(); $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['PMA_Config']->enableBc(); $GLOBALS['server'] = 0; diff --git a/test/classes/Plugins/Auth/AuthenticationSignonTest.php b/test/classes/Plugins/Auth/AuthenticationSignonTest.php index e986731041..7cdaa6b0f1 100644 --- a/test/classes/Plugins/Auth/AuthenticationSignonTest.php +++ b/test/classes/Plugins/Auth/AuthenticationSignonTest.php @@ -157,6 +157,7 @@ class AuthenticationSignonTest extends PmaTestCase */ public function testAuthCheckToken() { + $_SESSION = []; $this->mockResponse('Location: https://example.com/SignonURL'); $GLOBALS['cfg']['Server']['SignonURL'] = 'https://example.com/SignonURL'; @@ -398,6 +399,7 @@ class AuthenticationSignonTest extends PmaTestCase { $GLOBALS['cfg']['Server']['SignonSession'] = 'newSession'; $_COOKIE['newSession'] = '42'; + unset($GLOBALS['errno']); $this->object = $this->getMockBuilder(AuthenticationSignon::class) ->disableOriginalConstructor() diff --git a/test/classes/Plugins/Export/ExportCsvTest.php b/test/classes/Plugins/Export/ExportCsvTest.php index edd2fd44d9..d20403fe18 100644 --- a/test/classes/Plugins/Export/ExportCsvTest.php +++ b/test/classes/Plugins/Export/ExportCsvTest.php @@ -546,6 +546,8 @@ class ExportCsvTest extends PmaTestCase $GLOBALS['buffer_needed'] = false; $GLOBALS['asfile'] = true; $GLOBALS['save_on_server'] = false; + $GLOBALS['csv_enclosed'] = ''; + $GLOBALS['csv_separator'] = ''; ob_start(); $this->assertTrue( @@ -597,6 +599,7 @@ class ExportCsvTest extends PmaTestCase $GLOBALS['dbi'] = $dbi; $GLOBALS['csv_enclosed'] = '"'; + $GLOBALS['csv_escaped'] = ''; ob_start(); $this->assertTrue( diff --git a/test/classes/Plugins/Export/ExportHtmlwordTest.php b/test/classes/Plugins/Export/ExportHtmlwordTest.php index 1c2a05eb9c..6a1b3edbba 100644 --- a/test/classes/Plugins/Export/ExportHtmlwordTest.php +++ b/test/classes/Plugins/Export/ExportHtmlwordTest.php @@ -38,6 +38,7 @@ class ExportHtmlwordTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; $this->object = new ExportHtmlword(); $GLOBALS['output_kanji_conversion'] = false; diff --git a/test/classes/Plugins/Export/ExportJsonTest.php b/test/classes/Plugins/Export/ExportJsonTest.php index 6cf158ba0c..a2d4a2ce4b 100644 --- a/test/classes/Plugins/Export/ExportJsonTest.php +++ b/test/classes/Plugins/Export/ExportJsonTest.php @@ -159,6 +159,8 @@ class ExportJsonTest extends PmaTestCase */ public function testExportFooter() { + $GLOBALS['crlf'] = ''; + $this->expectOutputString( ']' ); diff --git a/test/classes/Plugins/Export/ExportLatexTest.php b/test/classes/Plugins/Export/ExportLatexTest.php index f38293b66d..27e7a32705 100644 --- a/test/classes/Plugins/Export/ExportLatexTest.php +++ b/test/classes/Plugins/Export/ExportLatexTest.php @@ -37,6 +37,7 @@ class ExportLatexTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; $GLOBALS['output_kanji_conversion'] = false; $GLOBALS['output_charset_conversion'] = false; diff --git a/test/classes/Plugins/Export/ExportOdtTest.php b/test/classes/Plugins/Export/ExportOdtTest.php index c774bd65bd..c464550fff 100644 --- a/test/classes/Plugins/Export/ExportOdtTest.php +++ b/test/classes/Plugins/Export/ExportOdtTest.php @@ -36,6 +36,7 @@ class ExportOdtTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; $GLOBALS['output_kanji_conversion'] = false; $GLOBALS['output_charset_conversion'] = false; @@ -483,6 +484,7 @@ class ExportOdtTest extends PmaTestCase $GLOBALS['dbi'] = $dbi; $GLOBALS['what'] = 'foo'; $GLOBALS['foo_null'] = '&'; + unset($GLOBALS['foo_columns']); $this->assertTrue( $this->object->exportData( diff --git a/test/classes/Plugins/Export/ExportSqlTest.php b/test/classes/Plugins/Export/ExportSqlTest.php index 723a0ef916..35036615cf 100644 --- a/test/classes/Plugins/Export/ExportSqlTest.php +++ b/test/classes/Plugins/Export/ExportSqlTest.php @@ -42,6 +42,7 @@ class ExportSqlTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; $GLOBALS['db'] = 'db'; $GLOBALS['output_kanji_conversion'] = false; @@ -469,6 +470,7 @@ class ExportSqlTest extends PmaTestCase */ public function testExportFooter() { + $GLOBALS['crlf'] = ''; $GLOBALS['sql_disable_fk'] = true; $GLOBALS['sql_use_transaction'] = true; $GLOBALS['charset'] = 'utf-8'; @@ -1466,6 +1468,7 @@ class ExportSqlTest extends PmaTestCase ); $GLOBALS['dbi'] = $dbi; $GLOBALS['sql_views_as_tables'] = true; + unset($GLOBALS['sql_if_not_exists']); ob_start(); $this->assertTrue( diff --git a/test/classes/Plugins/Export/ExportTexytextTest.php b/test/classes/Plugins/Export/ExportTexytextTest.php index 15c72d78db..41e06548e2 100644 --- a/test/classes/Plugins/Export/ExportTexytextTest.php +++ b/test/classes/Plugins/Export/ExportTexytextTest.php @@ -37,6 +37,7 @@ class ExportTexytextTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; $GLOBALS['output_kanji_conversion'] = false; $GLOBALS['buffer_needed'] = false; diff --git a/test/classes/Plugins/Import/ImportCsvTest.php b/test/classes/Plugins/Import/ImportCsvTest.php index 6923eea4ee..ac48b28aa4 100644 --- a/test/classes/Plugins/Import/ImportCsvTest.php +++ b/test/classes/Plugins/Import/ImportCsvTest.php @@ -32,6 +32,7 @@ class ImportCsvTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; $GLOBALS['plugin_param'] = 'csv'; $this->object = new ImportCsv(); @@ -167,6 +168,10 @@ class ImportCsvTest extends PmaTestCase true, $GLOBALS['finished'] ); + + unset($_REQUEST['csv_new_tbl_name']); + unset($_REQUEST['csv_new_db_name']); + unset($_REQUEST['csv_partial_import']); } /** diff --git a/test/classes/Plugins/Import/ImportMediawikiTest.php b/test/classes/Plugins/Import/ImportMediawikiTest.php index a136feb2ea..e270eb26a7 100644 --- a/test/classes/Plugins/Import/ImportMediawikiTest.php +++ b/test/classes/Plugins/Import/ImportMediawikiTest.php @@ -28,6 +28,7 @@ class ImportMediawikiTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; $GLOBALS['plugin_param'] = 'database'; $this->object = new ImportMediawiki(); diff --git a/test/classes/Plugins/Import/ImportOdsTest.php b/test/classes/Plugins/Import/ImportOdsTest.php index af79ac2c7c..c05d25f4ca 100644 --- a/test/classes/Plugins/Import/ImportOdsTest.php +++ b/test/classes/Plugins/Import/ImportOdsTest.php @@ -28,6 +28,7 @@ class ImportOdsTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; $GLOBALS['plugin_param'] = 'csv'; $this->object = new ImportOds(); diff --git a/test/classes/Plugins/Import/ImportShpTest.php b/test/classes/Plugins/Import/ImportShpTest.php index 2688f781ab..db1e05011d 100644 --- a/test/classes/Plugins/Import/ImportShpTest.php +++ b/test/classes/Plugins/Import/ImportShpTest.php @@ -34,6 +34,7 @@ class ImportShpTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); if (! defined('PMA_IS_WINDOWS')) { define('PMA_IS_WINDOWS', false); } diff --git a/test/classes/Plugins/Import/ImportXmlTest.php b/test/classes/Plugins/Import/ImportXmlTest.php index ec130100a8..0ce9a20c44 100644 --- a/test/classes/Plugins/Import/ImportXmlTest.php +++ b/test/classes/Plugins/Import/ImportXmlTest.php @@ -28,6 +28,7 @@ class ImportXmlTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); $GLOBALS['server'] = 0; $this->object = new ImportXml(); diff --git a/test/classes/Plugins/Transformations/TransformationPluginsTest.php b/test/classes/Plugins/Transformations/TransformationPluginsTest.php index 6aa4186812..9601de6741 100644 --- a/test/classes/Plugins/Transformations/TransformationPluginsTest.php +++ b/test/classes/Plugins/Transformations/TransformationPluginsTest.php @@ -45,6 +45,7 @@ class TransformationPluginsTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::setLanguage(); // For Application Octetstream Download plugin global $row, $fields_meta; $fields_meta = []; diff --git a/test/classes/RelationCleanupTest.php b/test/classes/RelationCleanupTest.php index 84313a3b56..31daf01520 100644 --- a/test/classes/RelationCleanupTest.php +++ b/test/classes/RelationCleanupTest.php @@ -31,6 +31,7 @@ class RelationCleanupTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + parent::setUpEnv(); $GLOBALS['server'] = 1; $_SESSION['relation'] = []; $_SESSION['relation'][$GLOBALS['server']] = [ diff --git a/test/classes/RelationTest.php b/test/classes/RelationTest.php index 84058856c0..67c39d9c3c 100644 --- a/test/classes/RelationTest.php +++ b/test/classes/RelationTest.php @@ -29,6 +29,7 @@ class RelationTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + parent::setTheme(); $GLOBALS['server'] = 1; $GLOBALS['db'] = 'db'; $GLOBALS['cfg']['Server']['user'] = 'root'; diff --git a/test/classes/ReplicationGuiTest.php b/test/classes/ReplicationGuiTest.php index ae7f9d5e29..82f8cf4c75 100644 --- a/test/classes/ReplicationGuiTest.php +++ b/test/classes/ReplicationGuiTest.php @@ -33,6 +33,7 @@ class ReplicationGuiTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + parent::setUpEnv(); //$_POST $_POST['mr_adduser'] = 'mr_adduser'; diff --git a/test/classes/RoutingTest.php b/test/classes/RoutingTest.php index 928756ee51..a3332ed00d 100644 --- a/test/classes/RoutingTest.php +++ b/test/classes/RoutingTest.php @@ -60,6 +60,7 @@ class RoutingTest extends PmaTestCase */ public function testGetCurrentRoutePost(): void { + unset($_GET['route']); $_POST['route'] = '/testpost'; $this->assertSame('/testpost', Routing::getCurrentRoute()); } @@ -83,6 +84,8 @@ class RoutingTest extends PmaTestCase */ public function testGetCurrentRouteRedirectDbStructure(): void { + unset($_POST['route']); + unset($_GET['route']); $_GET['db'] = 'testDB'; $this->assertSame('/database/structure', Routing::getCurrentRoute()); } diff --git a/test/classes/SanitizeTest.php b/test/classes/SanitizeTest.php index b6d1423a4d..b495a10676 100644 --- a/test/classes/SanitizeTest.php +++ b/test/classes/SanitizeTest.php @@ -14,6 +14,17 @@ use PhpMyAdmin\Tests\AbstractTestCase; */ class SanitizeTest extends AbstractTestCase { + + /** + * Sets up the fixture, for example, opens a network connection. + * This method is called before a test is executed. + */ + protected function setUp(): void + { + parent::setUp(); + parent::setLanguage(); + } + /** * Tests for proper escaping of XSS. * diff --git a/test/classes/Server/PluginsTest.php b/test/classes/Server/PluginsTest.php index 6f9173286f..d12d993ac2 100644 --- a/test/classes/Server/PluginsTest.php +++ b/test/classes/Server/PluginsTest.php @@ -14,6 +14,7 @@ class PluginsTest extends AbstractTestCase public function testGetAll(): void { + parent::setUpEnv(); $GLOBALS['cfg']['MaxCharactersInDisplayedSQL'] = 1000; $GLOBALS['cfg']['Server']['DisableIS'] = false; $GLOBALS['server'] = 0; diff --git a/test/classes/Server/PrivilegesTest.php b/test/classes/Server/PrivilegesTest.php index 42d8c09f9d..22c14eeea2 100644 --- a/test/classes/Server/PrivilegesTest.php +++ b/test/classes/Server/PrivilegesTest.php @@ -38,6 +38,7 @@ class PrivilegesTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + parent::setLanguage(); $GLOBALS['PMA_Config'] = new Config(); $GLOBALS['PMA_Config']->enableBc(); $GLOBALS['cfg']['Server']['DisableIS'] = false; diff --git a/test/classes/Setup/ConfigGeneratorTest.php b/test/classes/Setup/ConfigGeneratorTest.php index 14a2ade2d5..b3f7e9b029 100644 --- a/test/classes/Setup/ConfigGeneratorTest.php +++ b/test/classes/Setup/ConfigGeneratorTest.php @@ -17,6 +17,17 @@ use ReflectionClass; */ class ConfigGeneratorTest extends PmaTestCase { + + /** + * Sets up the fixture, for example, opens a network connection. + * This method is called before a test is executed. + */ + protected function setUp(): void + { + parent::setUp(); + parent::loadDefaultConfig(); + } + /** * Test for ConfigGenerator::getConfigFile * diff --git a/test/classes/Setup/FormProcessingTest.php b/test/classes/Setup/FormProcessingTest.php index 465767a447..b52c6cfc3e 100644 --- a/test/classes/Setup/FormProcessingTest.php +++ b/test/classes/Setup/FormProcessingTest.php @@ -23,6 +23,8 @@ class FormProcessingTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); + parent::setLanguage(); $GLOBALS['server'] = 1; $GLOBALS['db'] = 'db'; $GLOBALS['table'] = 'table'; diff --git a/test/classes/SqlQueryFormTest.php b/test/classes/SqlQueryFormTest.php index 51e9dadfb9..229a79349e 100644 --- a/test/classes/SqlQueryFormTest.php +++ b/test/classes/SqlQueryFormTest.php @@ -32,6 +32,7 @@ class SqlQueryFormTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + parent::setLanguage(); $this->sqlQueryForm = new SqlQueryForm(new Template()); //$GLOBALS diff --git a/test/classes/Table/SearchTest.php b/test/classes/Table/SearchTest.php index 28409e4d9f..9f0a706085 100644 --- a/test/classes/Table/SearchTest.php +++ b/test/classes/Table/SearchTest.php @@ -14,6 +14,7 @@ class SearchTest extends AbstractTestCase protected function setUp(): void { parent::setUp(); + parent::setUpEnv(); global $dbi; $this->search = new Search($dbi); diff --git a/test/classes/TableTest.php b/test/classes/TableTest.php index d2a3a92456..81bb4809db 100644 --- a/test/classes/TableTest.php +++ b/test/classes/TableTest.php @@ -25,6 +25,8 @@ class TableTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::loadDefaultConfig(); + /** * SET these to avoid undefined index error */ diff --git a/test/classes/ThemeTest.php b/test/classes/ThemeTest.php index b74ca9a933..3f25186aee 100644 --- a/test/classes/ThemeTest.php +++ b/test/classes/ThemeTest.php @@ -28,6 +28,7 @@ class ThemeTest extends PmaTestCase protected function setUp(): void { parent::setUp(); + parent::setTheme(); $this->object = new Theme(); $this->backup = $GLOBALS['PMA_Theme']; $GLOBALS['PMA_Theme'] = $this->object; @@ -236,6 +237,7 @@ class ThemeTest extends PmaTestCase */ public function testGetPrintPreview() { + parent::setLanguage(); $this->assertStringContainsString( '