From eaed42d8e42e798469fec1ad781c06ae87a0979c Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Fri, 26 Apr 2013 14:11:41 +0200 Subject: [PATCH] tests: skip math table creation for SQLite DB SQLite has global indices, not per table one. When using the database updater to create the `unitest_math` table, we would get an error with a duplicate `math_inputhash` index which is created by the the database installer. This patch skips the testBasicCreateTable() test on sqlite. Change-Id: I6da56d67d7af45f86cf6163cf73f5464505b43f3 --- tests/MathDatabaseTest.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/MathDatabaseTest.php b/tests/MathDatabaseTest.php index 9014896..5b653fc 100644 --- a/tests/MathDatabaseTest.php +++ b/tests/MathDatabaseTest.php @@ -83,6 +83,12 @@ class MathDatabaseTest extends MediaWikiTestCase { * @covers MathHooks::onLoadExtensionSchemaUpdates */ public function testBasicCreateTable() { + if( $this->db->getType() === 'sqlite' ) { + $this->markTestSkipped( "SQLite has global indices. We cannot " . + "create the `unitest_math` table, its math_inputhash index " . + "would conflict with the one from the real `math` table." + ); + } global $wgDebugMath; $this->db->dropTable( "math", __METHOD__ ); $wgDebugMath = false; @@ -96,6 +102,4 @@ class MathDatabaseTest extends MediaWikiTestCase { $this->assertEquals( sizeof( $row ), 2 * self::NUM_BASIC_FIELDS ); } - - -} \ No newline at end of file +}