Fix Sqlite upgrade test when profiling to database is enabled
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Wed, 2 Jan 2013 13:52:02 +0000 (14:52 +0100)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Wed, 2 Jan 2013 13:52:02 +0000 (14:52 +0100)
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

tests/phpunit/includes/db/DatabaseSqliteTest.php

index 7958a8a..a391fc5 100644 (file)
@@ -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 );