3 * Bootstrap for phpMyAdmin tests
6 declare(strict_types
=1);
9 use PhpMyAdmin\DatabaseInterface
;
10 use PhpMyAdmin\MoTranslator\Loader
;
11 use PhpMyAdmin\Tests\Stubs\DbiDummy
;
13 if (! defined('ROOT_PATH')) {
14 // phpcs:disable PSR1.Files.SideEffects
15 define('ROOT_PATH', dirname(__DIR__
) . DIRECTORY_SEPARATOR
);
20 * Set precision to sane value, with higher values
21 * things behave slightly unexpectedly, for example
22 * round(1.2, 2) returns 1.199999999999999956.
24 ini_set('precision', '14');
26 // Let PHP complain about all errors
27 error_reporting(E_ALL
);
29 // Ensure PHP has set timezone
30 date_default_timezone_set('UTC');
32 // Adding phpMyAdmin sources to include path
34 get_include_path() . PATH_SEPARATOR
. dirname((string) realpath('../index.php'))
37 // Setting constants for testing
38 // phpcs:disable PSR1.Files.SideEffects
39 if (! defined('PHPMYADMIN')) {
40 define('PHPMYADMIN', 1);
41 define('TESTSUITE', 1);
45 require_once ROOT_PATH
. 'libraries/vendor_config.php';
46 require_once AUTOLOAD_FILE
;
47 Loader
::loadFunctions();
49 $GLOBALS['PMA_Config'] = new Config();
50 $GLOBALS['PMA_Config']->set('environment', 'development');
51 $GLOBALS['cfg']['environment'] = 'development';
53 /* Load Database interface */
54 $GLOBALS['dbi'] = DatabaseInterface
::load(new DbiDummy());