follow up r61357
[lhc/web/wiklou.git] / tests / bootstrap.php
1 <?php
2
3 /**
4 * Set up the MediaWiki environment when running tests with "phpunit" command
5 *
6 * Warning: this file is not included from global scope!
7 * @file
8 */
9
10 global $wgCommandLineMode, $IP;
11 $wgCommandLineMode = true;
12 $IP = dirname( dirname( __FILE__ ) );
13
14 define( 'MEDIAWIKI', true );
15 define( 'MW_PHPUNIT_TEST', true );
16
17 require_once "$IP/includes/Defines.php";
18 require_once "$IP/includes/AutoLoader.php";
19 require_once "$IP/LocalSettings.php";
20 require_once "$IP/includes/ProfilerStub.php";
21 require_once "$IP/includes/GlobalFunctions.php";
22 require_once "$IP/includes/Hooks.php";
23
24 // for php versions before 5.2.1
25 if ( !function_exists('sys_get_temp_dir')) {
26 function sys_get_temp_dir() {
27 if( $temp=getenv('TMP') ) return $temp;
28 if( $temp=getenv('TEMP') ) return $temp;
29 if( $temp=getenv('TMPDIR') ) return $temp;
30 $temp=tempnam(__FILE__,'');
31 if (file_exists($temp)) {
32 unlink($temp);
33 return dirname($temp);
34 }
35 return null;
36 }
37 }
38