blob: d5125b2d76864f01bee575a70d25b3dcfd30eb84 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
<?php
/**
* Bootstrap for phpMyAdmin tests
*/
declare(strict_types=1);
use PhpMyAdmin\Config;
use PhpMyAdmin\Core;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\MoTranslator\Loader;
use PhpMyAdmin\Tests\Stubs\DbiDummy;
if (! defined('ROOT_PATH')) {
// phpcs:disable PSR1.Files.SideEffects
define('ROOT_PATH', dirname(__DIR__) . DIRECTORY_SEPARATOR);
// phpcs:enable
}
/**
* Set precision to sane value, with higher values
* things behave slightly unexpectedly, for example
* round(1.2, 2) returns 1.199999999999999956.
*/
ini_set('precision', '14');
// Let PHP complain about all errors
error_reporting(E_ALL);
// Ensure PHP has set timezone
date_default_timezone_set('UTC');
// Adding phpMyAdmin sources to include path
set_include_path(
get_include_path() . PATH_SEPARATOR . dirname((string) realpath('../index.php'))
);
// Setting constants for testing
// phpcs:disable PSR1.Files.SideEffects
if (! defined('PHPMYADMIN')) {
define('PHPMYADMIN', 1);
define('TESTSUITE', 1);
}
// phpcs:enable
require_once ROOT_PATH . 'libraries/vendor_config.php';
require_once AUTOLOAD_FILE;
Loader::loadFunctions();
$GLOBALS['containerBuilder'] = Core::getContainerBuilder();
$GLOBALS['config'] = new Config();
$GLOBALS['config']->set('environment', 'development');
$GLOBALS['cfg']['environment'] = 'development';
/* Load Database interface */
$GLOBALS['dbi'] = DatabaseInterface::load(new DbiDummy());
|