r105753 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105752‎ | r105753 | r105754 >
Date:06:03, 10 December 2011
Author:aaron
Status:deferred
Tags:
Comment:
Modified paths:
  • /branches/FileBackend/phase3/tests/phpunit/MediaWikiTestCase.php (modified) (history)

Diff [purge]

Index: branches/FileBackend/phase3/tests/phpunit/MediaWikiTestCase.php
@@ -12,8 +12,9 @@
1313 protected $oldTablePrefix;
1414 protected $useTemporaryTables = true;
1515 protected $reuseDB = false;
 16+ protected $tablesUsed = array(); // tables with data
 17+
1618 private static $dbSetup = false;
17 - private static $tablesCloned = array();
1819
1920 /**
2021 * Table name prefixes. Oracle likes it shorter.
@@ -55,7 +56,7 @@
5657 $this->oldTablePrefix = $wgDBprefix;
5758
5859 if( !self::$dbSetup ) {
59 - self::$tablesCloned = $this->initDB();
 60+ $this->initDB();
6061 self::$dbSetup = true;
6162 }
6263
@@ -156,8 +157,6 @@
157158 if ( $this->db->getType() == 'oracle' ) {
158159 $this->db->query( 'BEGIN FILL_WIKI_INFO; END;' );
159160 }
160 -
161 - return $tablesCloned;
162161 }
163162
164163 /**
@@ -170,13 +169,13 @@
171170 wfGetLB()->closeAll();
172171 $this->db = wfGetDB( DB_MASTER );
173172 } else {
174 - foreach( self::$tablesCloned as $tbl ) {
 173+ foreach( $this->tablesUsed as $tbl ) {
175174 if( $tbl == 'interwiki') continue;
176175 $this->db->query( 'TRUNCATE TABLE '.$this->db->tableName($tbl), __METHOD__ );
177176 }
178177 }
179178 } else {
180 - foreach( self::$tablesCloned as $tbl ) {
 179+ foreach( $this->tablesUsed as $tbl ) {
181180 if( $tbl == 'interwiki' || $tbl == 'user' ) continue;
182181 $this->db->delete( $tbl, '*', __METHOD__ );
183182 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r105752FU r105154: only clear tables that tests specify as written to. This reduces ...aaron05:47, 10 December 2011

Status & tagging log