X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fdb%2FDatabaseSqliteTest.php;h=d32c1a6e1435ebd2f8aedd65c4deed57ee969b0e;hb=72bc1e8cf87ec368227fdae648ab7e5037a55bcf;hp=1db6faec53bf1c766d23e6d108e661fa42ccc2ab;hpb=4c413f2ae7020a0a5a87aa0814b67c2c18d09f35;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/db/DatabaseSqliteTest.php b/tests/phpunit/includes/db/DatabaseSqliteTest.php index 1db6faec53..d32c1a6e14 100644 --- a/tests/phpunit/includes/db/DatabaseSqliteTest.php +++ b/tests/phpunit/includes/db/DatabaseSqliteTest.php @@ -162,6 +162,9 @@ class DatabaseSqliteTest extends MediaWikiTestCase { $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')" ) + ); } /** @@ -269,7 +272,7 @@ class DatabaseSqliteTest extends MediaWikiTestCase { * @todo Currently only checks list of tables */ public function testUpgrades() { - global $IP, $wgVersion, $wgProfileToDatabase; + global $IP, $wgVersion, $wgProfiler; // Versions tested $versions = array( @@ -288,7 +291,18 @@ class DatabaseSqliteTest extends MediaWikiTestCase { $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 );