From: Alexandre Emsenhuber Date: Wed, 2 Jan 2013 13:52:02 +0000 (+0100) Subject: Fix Sqlite upgrade test when profiling to database is enabled X-Git-Tag: 1.31.0-rc.0~21135^2 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=fa4196bc53246b104ebfbbeb1f661466908e5ec8;p=lhc%2Fweb%2Fwiklou.git Fix Sqlite upgrade test when profiling to database is enabled The 'profiling' table is missing from expected tables when $wgProfileToDatabase is set to true, since patch-profiling.sql is applied while updating in this case. Change-Id: Iedbe72dca1deda728304fb95fe19ef3b4bdad8de --- diff --git a/tests/phpunit/includes/db/DatabaseSqliteTest.php b/tests/phpunit/includes/db/DatabaseSqliteTest.php index 7958a8aa83..a391fc57ec 100644 --- a/tests/phpunit/includes/db/DatabaseSqliteTest.php +++ b/tests/phpunit/includes/db/DatabaseSqliteTest.php @@ -232,7 +232,7 @@ class DatabaseSqliteTest extends MediaWikiTestCase { * @todo: currently only checks list of tables */ public function testUpgrades() { - global $IP, $wgVersion; + global $IP, $wgVersion, $wgProfileToDatabase; // Versions tested $versions = array( @@ -251,6 +251,9 @@ class DatabaseSqliteTest extends MediaWikiTestCase { $currentDB = new DatabaseSqliteStandalone( ':memory:' ); $currentDB->sourceFile( "$IP/maintenance/tables.sql" ); + if ( $wgProfileToDatabase ) { + $currentDB->sourceFile( "$IP/maintenance/sqlite/archives/patch-profiling.sql" ); + } $currentTables = $this->getTables( $currentDB ); sort( $currentTables );