Follow up r85922 moving the </caption> to another line, fixing one of the tests added...
[lhc/web/wiklou.git] / tests / phpunit / phpunit.php
index 3b8795a..5c4db3a 100755 (executable)
@@ -15,11 +15,33 @@ $IP = dirname( dirname( dirname( __FILE__ ) ) );
 define( 'MW_PHPUNIT_TEST', true );
 
 // Start up MediaWiki in command-line mode
-require_once( "$IP/maintenance/commandLine.inc" );
+require_once( "$IP/maintenance/Maintenance.php" );
+
+class PHPUnitMaintClass extends Maintenance {
+       public function finalSetup() {
+               $settings = parent::finalSetup();
+
+               global $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType, $wgUseDatabaseMessages;
+
+               $wgMainCacheType = CACHE_NONE;
+               $wgMessageCacheType = CACHE_NONE;
+               $wgParserCacheType = CACHE_NONE;
+               $wgUseDatabaseMessages = false; # Set for future resets
+       }
+       public function execute() { }
+       public function getDbType() {
+               return Maintenance::DB_ADMIN;
+       }
+}
+
+$maintClass = 'PHPUnitMaintClass';
+require( RUN_MAINTENANCE_IF_MAIN );
 
 // Assume UTC for testing purposes
 $wgLocaltimezone = 'UTC';
 
+$wgLocalisationCacheConf['storeClass'] =  'LCStore_Null';
+
 if( !in_array( '--configuration', $_SERVER['argv'] ) ) {
        //Hack to eliminate the need to use the Makefile (which sucks ATM)
        $_SERVER['argv'][] = '--configuration';
@@ -35,10 +57,6 @@ if( version_compare( PHPUnit_Runner_Version::id(), '3.5.0', '>=' ) ) {
        require_once( 'PHPUnit/TextUI/Command.php' );
 }
 
-$additionalMWCLIArgs = array(
-       'verbose' => false,
-);
-
-require_once( "$IP/tests/phpunit/MediaWikiPHPUnitCommand.php" );
+require_once( "$IP/tests/TestsAutoLoader.php" );
 MediaWikiPHPUnitCommand::main();