Merge "Maintenance script for exporting site definitions"
[lhc/web/wiklou.git] / tests / phpunit / MediaWikiTestCase.php
index 327c1da..e49c391 100644 (file)
@@ -117,34 +117,22 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                        $this->checkDbIsSupported();
 
                        if ( !self::$dbSetup ) {
-                               wfProfileIn( $logName . ' (clone-db)' );
-
                                // switch to a temporary clone of the database
                                self::setupTestDB( $this->db, $this->dbPrefix() );
 
                                if ( ( $this->db->getType() == 'oracle' || !self::$useTemporaryTables ) && self::$reuseDB ) {
                                        $this->resetDB();
                                }
-
-                               wfProfileOut( $logName . ' (clone-db)' );
                        }
-
-                       wfProfileIn( $logName . ' (prepare-db)' );
                        $this->addCoreDBData();
                        $this->addDBData();
-                       wfProfileOut( $logName . ' (prepare-db)' );
-
                        $needsResetDB = true;
                }
 
-               wfProfileIn( $logName );
                parent::run( $result );
-               wfProfileOut( $logName );
 
                if ( $needsResetDB ) {
-                       wfProfileIn( $logName . ' (reset-db)' );
                        $this->resetDB();
-                       wfProfileOut( $logName . ' (reset-db)' );
                }
        }
 
@@ -198,7 +186,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
        }
 
        protected function setUp() {
-               wfProfileIn( __METHOD__ );
                parent::setUp();
                $this->called['setUp'] = true;
 
@@ -225,12 +212,13 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
 
                DeferredUpdates::clearPendingUpdates();
 
-               wfProfileOut( __METHOD__ );
        }
 
-       protected function tearDown() {
-               wfProfileIn( __METHOD__ );
+       protected function addTmpFiles( $files ) {
+               $this->tmpFiles = array_merge( $this->tmpFiles, (array)$files );
+       }
 
+       protected function tearDown() {
                $this->called['tearDown'] = true;
                // Cleaning up temporary files
                foreach ( $this->tmpFiles as $fileName ) {
@@ -273,7 +261,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                }
 
                parent::tearDown();
-               wfProfileOut( __METHOD__ );
        }
 
        /**