From: aude Date: Sat, 18 Oct 2014 12:56:19 +0000 (+0200) Subject: Skip tests in PrefixSearchTest if not wikitext main namespace X-Git-Tag: 1.31.0-rc.0~13567^2 X-Git-Url: https://git.cyclocoop.org//%22?a=commitdiff_plain;h=cb576ef0b060ede4ce99240324f068c978025e77;p=lhc%2Fweb%2Fwiklou.git Skip tests in PrefixSearchTest if not wikitext main namespace Otherwise, running core tests with non-wikitext in the main namespace fail with fatal error. Change-Id: I895e7ee61ba80c0c345b6c05f05d05c368e52d59 --- diff --git a/tests/phpunit/includes/PrefixSearchTest.php b/tests/phpunit/includes/PrefixSearchTest.php index 5390dba63d..5b164352e8 100644 --- a/tests/phpunit/includes/PrefixSearchTest.php +++ b/tests/phpunit/includes/PrefixSearchTest.php @@ -8,6 +8,12 @@ class PrefixSearchTest extends MediaWikiTestCase { protected function setUp() { parent::setUp(); + if ( !$this->isWikitextNS( NS_MAIN ) ) { + $this->markTestSkipped( 'Main namespace does not support wikitext.' ); + } + + $this->insertPages(); + // Avoid special pages from extensions interferring with the tests $this->setMwGlobals( 'wgSpecialPages', array() ); } @@ -27,7 +33,7 @@ class PrefixSearchTest extends MediaWikiTestCase { } } - public function addDBData() { + public function insertPages() { $this->insertPage( 'Sandbox' ); $this->insertPage( 'Bar' ); $this->insertPage( 'Example' );