From 3252fbea1d4451c5c840ac9665398a330cae1fd7 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sat, 16 Oct 2010 13:24:35 +0000 Subject: [PATCH] * Fix r74790 by actually calling setup (using parent::setup) * Replace inexistant markTestIgnored() method with markTestSkipped() * Add comments --- .../tests/phpunit/includes/search/SearchDbTest.php | 4 ++++ .../tests/phpunit/includes/search/SearchEngineTest.php | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/maintenance/tests/phpunit/includes/search/SearchDbTest.php b/maintenance/tests/phpunit/includes/search/SearchDbTest.php index d103ad491e..eecedfd06d 100644 --- a/maintenance/tests/phpunit/includes/search/SearchDbTest.php +++ b/maintenance/tests/phpunit/includes/search/SearchDbTest.php @@ -6,11 +6,15 @@ class SearchDbTest extends SearchEngineTest { var $db; function setUp() { + // Get a database connection or skip test $this->db = wfGetDB( DB_MASTER ); if ( !$this->db ) { $this->markTestIncomplete( "Can't find a database to test with." ); } + parent::setup(); + + // Initialize search database with data $GLOBALS['wgContLang'] = new Language; $this->insertSearchData(); diff --git a/maintenance/tests/phpunit/includes/search/SearchEngineTest.php b/maintenance/tests/phpunit/includes/search/SearchEngineTest.php index 5fd84c6627..024b440c44 100644 --- a/maintenance/tests/phpunit/includes/search/SearchEngineTest.php +++ b/maintenance/tests/phpunit/includes/search/SearchEngineTest.php @@ -3,6 +3,7 @@ require_once dirname(dirname(dirname(__FILE__))). '/bootstrap.php'; /** + * This class is not directly tested. Instead it is extended by SearchDbTest. * @group Stub */ class SearchEngineTest extends MediaWikiTestSetup { @@ -13,16 +14,15 @@ class SearchEngineTest extends MediaWikiTestSetup { * Will skip current test if DB does not support search. */ function setup() { - // Get database type and version + // Search tests require MySQL or SQLite with FTS + # Get database type and version $dbType = $this->db->getType(); - - // will skip unless mysql or sqlite with FTS $dbSupported = ($dbType === 'mysql') || ( $dbType === 'sqlite' && $this->db->getFulltextSearchModule() == 'FTS3' ); if( !$dbSupported ) { - $this->markTestIgnored( "MySQL or SQLite with FTS3 only" ); + $this->markTestSkipped( "MySQL or SQLite with FTS3 only" ); } } -- 2.20.1