NS_MAIN can locally have subpages enabled
authorAntoine Musso <hashar@users.mediawiki.org>
Fri, 15 Jul 2011 09:45:57 +0000 (09:45 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Fri, 15 Jul 2011 09:45:57 +0000 (09:45 +0000)
This workaround test if any local change has been made, if so the test
will be skipped.

fu r82577

tests/phpunit/includes/MWNamespaceTest.php

index 8ec8ab7..7da1864 100644 (file)
@@ -271,7 +271,14 @@ class MWNamespaceTest extends MediaWikiTestCase {
                $this->assertFalse( MWNamespace::hasSubpages( NS_SPECIAL ) );
 
                // namespaces without subpages
-               $this->assertFalse( MWNamespace::hasSubpages( NS_MAIN ) );
+               global $wgNamespacesWithSubpages;
+               if(    array_key_exists( NS_MAIN, $wgNamespacesWithSubpages )
+                       && $wgNamespacesWithSubpages[NS_MAIN] === true
+               ) {
+                       $this->markTestSkipped( "Main namespace has subpages enabled" );
+               } else {
+                       $this->assertFalse( MWNamespace::hasSubpages( NS_MAIN ) );
+               }
 
                // Some namespaces with subpages
                $this->assertTrue( MWNamespace::hasSubpages( NS_TALK      ) );