From: Antoine Musso Date: Sat, 16 Oct 2010 13:24:35 +0000 (+0000) Subject: * Fix r74790 by actually calling setup (using parent::setup) X-Git-Tag: 1.31.0-rc.0~34483 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=3252fbea1d4451c5c840ac9665398a330cae1fd7;p=lhc%2Fweb%2Fwiklou.git * Fix r74790 by actually calling setup (using parent::setup) * Replace inexistant markTestIgnored() method with markTestSkipped() * Add comments --- 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" ); } }