From cb576ef0b060ede4ce99240324f068c978025e77 Mon Sep 17 00:00:00 2001 From: aude Date: Sat, 18 Oct 2014 14:56:19 +0200 Subject: [PATCH] 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 --- tests/phpunit/includes/PrefixSearchTest.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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' ); -- 2.20.1