Index: trunk/phase3/tests/phpunit/MediaWikiTestCase.php |
— | — | @@ -12,8 +12,9 @@ |
13 | 13 | protected $oldTablePrefix; |
14 | 14 | protected $useTemporaryTables = true; |
15 | 15 | protected $reuseDB = false; |
| 16 | + protected $tablesUsed = array(); // tables with data |
| 17 | + |
16 | 18 | private static $dbSetup = false; |
17 | | - private static $tablesCloned = array(); |
18 | 19 | |
19 | 20 | /** |
20 | 21 | * Table name prefixes. Oracle likes it shorter. |
— | — | @@ -55,7 +56,7 @@ |
56 | 57 | $this->oldTablePrefix = $wgDBprefix; |
57 | 58 | |
58 | 59 | if( !self::$dbSetup ) { |
59 | | - self::$tablesCloned = $this->initDB(); |
| 60 | + $this->initDB(); |
60 | 61 | self::$dbSetup = true; |
61 | 62 | } |
62 | 63 | |
— | — | @@ -156,8 +157,6 @@ |
157 | 158 | if ( $this->db->getType() == 'oracle' ) { |
158 | 159 | $this->db->query( 'BEGIN FILL_WIKI_INFO; END;' ); |
159 | 160 | } |
160 | | - |
161 | | - return $tablesCloned; |
162 | 161 | } |
163 | 162 | |
164 | 163 | /** |
— | — | @@ -170,13 +169,13 @@ |
171 | 170 | wfGetLB()->closeAll(); |
172 | 171 | $this->db = wfGetDB( DB_MASTER ); |
173 | 172 | } else { |
174 | | - foreach( self::$tablesCloned as $tbl ) { |
| 173 | + foreach( $this->tablesUsed as $tbl ) { |
175 | 174 | if( $tbl == 'interwiki') continue; |
176 | 175 | $this->db->query( 'TRUNCATE TABLE '.$this->db->tableName($tbl), __METHOD__ ); |
177 | 176 | } |
178 | 177 | } |
179 | 178 | } else { |
180 | | - foreach( self::$tablesCloned as $tbl ) { |
| 179 | + foreach( $this->tablesUsed as $tbl ) { |
181 | 180 | if( $tbl == 'interwiki' || $tbl == 'user' ) continue; |
182 | 181 | $this->db->delete( $tbl, '*', __METHOD__ ); |
183 | 182 | } |