4 * Bootstrapping for MediaWiki PHPUnit tests
11 // Evaluate the include path relative to this file
12 $IP = dirname( dirname( dirname( __FILE__
) ) );
14 // Set a flag which can be used to detect when other scripts have been entered through this entry point or not
15 define( 'MW_PHPUNIT_TEST', true );
17 // Start up MediaWiki in command-line mode
18 require_once( "$IP/maintenance/commandLine.inc" );
20 // Assume UTC for testing purposes
21 $wgLocaltimezone = 'UTC';
23 $wgLocalisationCacheConf['storeClass'] = 'LCStore_Null';
25 if( !in_array( '--configuration', $_SERVER['argv'] ) ) {
26 //Hack to eliminate the need to use the Makefile (which sucks ATM)
27 $_SERVER['argv'][] = '--configuration';
28 $_SERVER['argv'][] = $IP . '/tests/phpunit/suite.xml';
31 require_once( 'PHPUnit/Runner/Version.php' );
32 if( version_compare( PHPUnit_Runner_Version
::id(), '3.5.0', '>=' ) ) {
33 # PHPUnit 3.5.0 introduced a nice autoloader based on class name
34 require_once( 'PHPUnit/Autoload.php' );
36 # Keep the old pre PHPUnit 3.5.0 behaviour for compatibility
37 require_once( 'PHPUnit/TextUI/Command.php' );
40 require_once( "$IP/tests/TestsAutoLoader.php" );
41 MediaWikiPHPUnitCommand
::main();