From 515c81b048f57e4617c7b6bf64212eb077252329 Mon Sep 17 00:00:00 2001 From: aude Date: Fri, 14 Aug 2015 11:32:08 +0200 Subject: [PATCH] Skip adding wikitext test pages in PrefixSearchTest if NS_MAIN is not wikitext these tests get skipped and so should adding these pages, since it leads to a fatal error and inability to run tests on such a wiki. Bug: T97416 Change-Id: Icc4e325ecbc5ed069d12bbad686812f6a45b47e7 --- tests/phpunit/includes/PrefixSearchTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/phpunit/includes/PrefixSearchTest.php b/tests/phpunit/includes/PrefixSearchTest.php index d63541b7e3..afd10e9a04 100644 --- a/tests/phpunit/includes/PrefixSearchTest.php +++ b/tests/phpunit/includes/PrefixSearchTest.php @@ -6,6 +6,11 @@ class PrefixSearchTest extends MediaWikiLangTestCase { public function addDBData() { + if ( !$this->isWikitextNS( NS_MAIN ) ) { + // tests are skipped if NS_MAIN is not wikitext + return; + } + $this->insertPage( 'Sandbox' ); $this->insertPage( 'Bar' ); $this->insertPage( 'Example' ); -- 2.20.1