$this->assertEquals( "DROP INDEX foo -- dropping index",
$this->replaceVars( "DROP INDEX /*i*/foo ON /*_*/bar -- dropping index" )
);
+ $this->assertEquals( "INSERT OR IGNORE INTO foo VALUES ('bar')",
+ $this->replaceVars( "INSERT OR IGNORE INTO foo VALUES ('bar')" )
+ );
}
/**
* @todo Currently only checks list of tables
*/
public function testUpgrades() {
- global $IP, $wgVersion, $wgProfileToDatabase;
+ global $IP, $wgVersion, $wgProfiler;
// Versions tested
$versions = array(
$currentDB = new DatabaseSqliteStandalone( ':memory:' );
$currentDB->sourceFile( "$IP/maintenance/tables.sql" );
- if ( $wgProfileToDatabase ) {
+
+ $profileToDb = false;
+ if ( isset( $wgProfiler['output'] ) ) {
+ $out = $wgProfiler['output'];
+ if ( $out === 'db' ) {
+ $profileToDb = true;
+ } elseif ( is_array( $out ) && in_array( 'db', $out ) ) {
+ $profileToDb = true;
+ }
+ }
+
+ if ( $profileToDb ) {
$currentDB->sourceFile( "$IP/maintenance/sqlite/archives/patch-profiling.sql" );
}
$currentTables = $this->getTables( $currentDB );