Merge pull request #4185 from samuelsov/CRM-15330
[civicrm-core.git] / tests / phpunit / CiviTest / bootstrap.php
CommitLineData
781cfdd0
TO
1<?php
2// ADAPTED FROM tools/scripts/phpunit
3
4$GLOBALS['base_dir'] = dirname(dirname(dirname(__DIR__)));
86bfa4f6
TO
5$tests_dir = $GLOBALS['base_dir'] . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'phpunit';
6$civi_pkgs_dir = $GLOBALS['base_dir'] . DIRECTORY_SEPARATOR . 'packages';
781cfdd0
TO
7ini_set('safe_mode', 0);
8ini_set('include_path',
92915c55
TO
9 "{$GLOBALS['base_dir']}" . PATH_SEPARATOR .
10 "$tests_dir" . PATH_SEPARATOR .
11 "$civi_pkgs_dir" . PATH_SEPARATOR
12 . ini_get('include_path'));
781cfdd0
TO
13
14# Relying on system timezone setting produces a warning,
15# doing the following prevents the warning message
481a74f4
TO
16if (file_exists('/etc/timezone')) {
17 $timezone = trim(file_get_contents('/etc/timezone'));
18 if (ini_set('date.timezone', $timezone) === FALSE) {
6c6e6187
TO
19 echo "ini_set( 'date.timezone', '$timezone' ) failed\n";
20 }
781cfdd0
TO
21}
22
23# Crank up the memory
24ini_set('memory_limit', '2G');
25
ac0b2c9c 26require_once $GLOBALS['base_dir'] . '/vendor/autoload.php';
781cfdd0
TO
27
28/*
29require $GLOBALS['base_dir'] . DIRECTORY_SEPARATOR .
e70a7fc0
TO
30'packages' . DIRECTORY_SEPARATOR .
31'PHPUnit' . DIRECTORY_SEPARATOR .
32'Autoload.php';
33 */