2 // ADAPTED FROM tools/scripts/phpunit
4 $GLOBALS['base_dir'] = dirname(dirname(dirname(__DIR__
)));
5 $tests_dir = $GLOBALS['base_dir'] . DIRECTORY_SEPARATOR
. 'tests' . DIRECTORY_SEPARATOR
. 'phpunit';
6 $civi_pkgs_dir = $GLOBALS['base_dir'] . DIRECTORY_SEPARATOR
. 'packages';
7 ini_set('safe_mode', 0);
8 ini_set('include_path',
9 "{$GLOBALS['base_dir']}" . PATH_SEPARATOR
.
10 "$tests_dir" . PATH_SEPARATOR
.
11 "$civi_pkgs_dir" . PATH_SEPARATOR
12 . ini_get('include_path'));
14 # Relying on system timezone setting produces a warning,
15 # doing the following prevents the warning message
16 if (file_exists('/etc/timezone')) {
17 $timezone = trim(file_get_contents('/etc/timezone'));
18 if (ini_set('date.timezone', $timezone) === FALSE) {
19 echo "ini_set( 'date.timezone', '$timezone' ) failed\n";
24 ini_set('memory_limit', '2G');
26 require_once $GLOBALS['base_dir'] . '/vendor/autoload.php';
29 require $GLOBALS['base_dir'] . DIRECTORY_SEPARATOR .
30 'packages' . DIRECTORY_SEPARATOR .
31 'PHPUnit' . DIRECTORY_SEPARATOR .
35 if (!defined('CIVICRM_UF') && getenv('CIVICRM_UF')) {
36 define('CIVICRM_UF', getenv('CIVICRM_UF'));