4 * Set up the MediaWiki environment when running tests with "phpunit" command
6 * Warning: this file is not included from global scope!
10 global $wgCommandLineMode, $IP;
11 $wgCommandLineMode = true;
12 $IP = dirname( dirname( __FILE__
) );
14 define( 'MEDIAWIKI', true );
15 define( 'MW_PHPUNIT_TEST', true );
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";
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)) {
33 return dirname($temp);