Mostly revert r89302, was slower than the original
authorChad Horohoe <demon@users.mediawiki.org>
Wed, 1 Jun 2011 23:17:29 +0000 (23:17 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Wed, 1 Jun 2011 23:17:29 +0000 (23:17 +0000)
tests/phpunit/MediaWikiTestCase.php

index deea8a0..39d7d29 100644 (file)
@@ -12,7 +12,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
        protected $oldTablePrefix;
        protected $useTemporaryTables = true;
        private static $dbSetup = false;
-       private static $dbTables = null;
 
        /**
         * Table name prefixes. Oracle likes it shorter.
@@ -192,22 +191,18 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
        protected function listTables() {
                global $wgDBprefix;
 
-               if( is_null( self::$dbTables ) ) {
-                       $tables = $this->db->listTables( $wgDBprefix, __METHOD__ );
-                       $tables = array_map( array( __CLASS__, 'unprefixTable' ), $tables );
-
-                       if ( $this->db->getType() == 'sqlite' ) {
-                               $tables = array_flip( $tables );
-                               // these are subtables of searchindex and don't need to be duped/dropped separately
-                               unset( $tables['searchindex_content'] );
-                               unset( $tables['searchindex_segdir'] );
-                               unset( $tables['searchindex_segments'] );
-                               $tables = array_flip( $tables );
-                       }
-                       self::$dbTables = $tables;
+               $tables = $this->db->listTables( $wgDBprefix, __METHOD__ );
+               $tables = array_map( array( __CLASS__, 'unprefixTable' ), $tables );
+
+               if ( $this->db->getType() == 'sqlite' ) {
+                       $tables = array_flip( $tables );
+                       // these are subtables of searchindex and don't need to be duped/dropped separately
+                       unset( $tables['searchindex_content'] );
+                       unset( $tables['searchindex_segdir'] );
+                       unset( $tables['searchindex_segments'] );
+                       $tables = array_flip( $tables );
                }
-               return self::$dbTables;
-               
+               return $tables;
        }
        
        protected function checkDbIsSupported() {