Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Desportes <williamdes@wdes.fr>2020-05-21 02:40:24 +0300
committerWilliam Desportes <williamdes@wdes.fr>2020-05-21 03:07:45 +0300
commit13eaeadbf939b234efb745789ee250bc66f0c81f (patch)
treee70af93563bdfd22fb340f803d1dfacfff25b125 /test/bootstrap-dist.php
parent8f7d3d1fa76bf006dca38e2ff5b424af1055b931 (diff)
Clean bootstrap-dist file
Signed-off-by: William Desportes <williamdes@wdes.fr>
Diffstat (limited to 'test/bootstrap-dist.php')
-rw-r--r--test/bootstrap-dist.php43
1 files changed, 9 insertions, 34 deletions
diff --git a/test/bootstrap-dist.php b/test/bootstrap-dist.php
index 84ec3e99b1..66d7dcc71f 100644
--- a/test/bootstrap-dist.php
+++ b/test/bootstrap-dist.php
@@ -10,7 +10,6 @@ use PhpMyAdmin\Language;
use PhpMyAdmin\LanguageManager;
use PhpMyAdmin\MoTranslator\Loader;
use PhpMyAdmin\Tests\Stubs\DbiDummy;
-use PhpMyAdmin\Theme;
if (! defined('ROOT_PATH')) {
// phpcs:disable PSR1.Files.SideEffects
@@ -38,8 +37,10 @@ set_include_path(
// Setting constants for testing
// phpcs:disable PSR1.Files.SideEffects
-define('PHPMYADMIN', 1);
-define('TESTSUITE', 1);
+if (! defined('PHPMYADMIN')) {
+ define('PHPMYADMIN', 1);
+ define('TESTSUITE', 1);
+}
// phpcs:enable
// Selenium tests setup
@@ -73,45 +74,19 @@ if (PHP_SAPI == 'cli') {
require_once ROOT_PATH . 'libraries/vendor_config.php';
require_once AUTOLOAD_FILE;
Loader::loadFunctions();
+
$GLOBALS['PMA_Config'] = new Config();
$GLOBALS['PMA_Config']->set('environment', 'development');
$GLOBALS['cfg']['environment'] = 'development';
// Initialize PMA_VERSION variable
// phpcs:disable PSR1.Files.SideEffects
-define('PMA_VERSION', $GLOBALS['PMA_Config']->get('PMA_VERSION'));
-define('PMA_MAJOR_VERSION', $GLOBALS['PMA_Config']->get('PMA_MAJOR_VERSION'));
+if (! defined('PMA_VERSION')) {
+ define('PMA_VERSION', $GLOBALS['PMA_Config']->get('PMA_VERSION'));
+ define('PMA_MAJOR_VERSION', $GLOBALS['PMA_Config']->get('PMA_MAJOR_VERSION'));
+}
// phpcs:enable
-/* Ensure default language is active */
-/** @var Language $languageEn */
-$languageEn = LanguageManager::getInstance()->getLanguage('en');
-$languageEn->activate();
-
/* Load Database interface */
$GLOBALS['dbi'] = DatabaseInterface::load(new DbiDummy());
-$httpProxy = getenv('http_proxy');
-$urlInfo = parse_url((string) $httpProxy);
-
-if (PHP_SAPI == 'cli' && is_array($urlInfo)) {
- $proxyUrl = ($urlInfo['host'] ?? '')
- . (isset($urlInfo['port']) ? ':' . $urlInfo['port'] : '');
- $proxyUser = $urlInfo['user'] ?? '';
- $proxyPass = $urlInfo['pass'] ?? '';
-}
-
-// phpcs:disable PSR1.Files.SideEffects
-define('PROXY_URL', $proxyUrl ?? '');
-define('PROXY_USER', $proxyUser ?? '');
-define('PROXY_PASS', $proxyPass ?? '');
-// phpcs:enable
-
-// Ensure we have session started
-session_start();
-
-// Standard environment for tests
-$_SESSION[' PMA_token '] = 'token';
-$GLOBALS['PMA_Theme'] = Theme::load(ROOT_PATH . 'themes/pmahomme');
-$_SESSION['tmpval']['pftext'] = 'F';
-$GLOBALS['lang'] = 'en';