From: Chad Horohoe Date: Wed, 1 Jun 2011 23:17:29 +0000 (+0000) Subject: Mostly revert r89302, was slower than the original X-Git-Tag: 1.31.0-rc.0~29787 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=a98cdb721de2dc30fee3c8792977aa54d46a3cf2;p=lhc%2Fweb%2Fwiklou.git Mostly revert r89302, was slower than the original --- diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index deea8a04d2..39d7d298f1 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -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() {