Skip tests in PrefixSearchTest if not wikitext main namespace
authoraude <aude.wiki@gmail.com>
Sat, 18 Oct 2014 12:56:19 +0000 (14:56 +0200)
committeraude <aude.wiki@gmail.com>
Sat, 18 Oct 2014 12:56:19 +0000 (14:56 +0200)
Otherwise, running core tests with non-wikitext in the main
namespace fail with fatal error.

Change-Id: I895e7ee61ba80c0c345b6c05f05d05c368e52d59

tests/phpunit/includes/PrefixSearchTest.php

index 5390dba..5b16435 100644 (file)
@@ -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' );