r89352 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89351‎ | r89352 | r89353 >
Date:17:58, 2 June 2011
Author:maxsem
Status:ok
Tags:
Comment:
Don't duplicate tables starting with unittest_ which can be left if a previous run ended with a fatal on SQLite
Modified paths:
  • /trunk/phase3/tests/phpunit/MediaWikiTestCase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/MediaWikiTestCase.php
@@ -188,12 +188,19 @@
189189 return substr( $tableName, strlen( $wgDBprefix ) );
190190 }
191191
 192+ static private function isNotUnittest( $table ) {
 193+ return strpos( $table, 'unittest_' ) !== 0;
 194+ }
 195+
192196 protected function listTables() {
193197 global $wgDBprefix;
194198
195199 $tables = $this->db->listTables( $wgDBprefix, __METHOD__ );
196200 $tables = array_map( array( __CLASS__, 'unprefixTable' ), $tables );
197201
 202+ // Don't duplicate test tables from the previous fataled run
 203+ $tables = array_filter( $tables, array( __CLASS__, 'isNotUnittest' ) );
 204+
198205 if ( $this->db->getType() == 'sqlite' ) {
199206 $tables = array_flip( $tables );
200207 // these are subtables of searchindex and don't need to be duped/dropped separately

Sign-offs

UserFlagDate
Hasharinspected07:56, 3 June 2011

Status & tagging log