Merge "add Interwiki::selectFields"
[lhc/web/wiklou.git] / tests / phpunit / includes / MWNamespaceTest.php
index 1b64114..da36ffd 100644 (file)
@@ -53,10 +53,6 @@ class MWNamespaceTest extends MediaWikiTestCase {
                $this->assertIsNotSubject( NS_TALK      );
                $this->assertIsNotSubject( NS_USER_TALK );
                $this->assertIsNotSubject( 101          ); # user defined
-
-               // Back compat
-               $this->assertTrue( MWNamespace::isMain( NS_MAIN ) == MWNamespace::isSubject( NS_MAIN ) );
-               $this->assertTrue( MWNamespace::isMain( NS_USER_TALK ) == MWNamespace::isSubject( NS_USER_TALK ) );
        }
 
        /**
@@ -198,11 +194,11 @@ class MWNamespaceTest extends MediaWikiTestCase {
        public function testSpecialAndMediaAreDifferentSubjects() {
                $this->assertDifferentSubject(
                        NS_MEDIA, NS_SPECIAL,
-                       "NS_MEDIA and NS_SPECIAL are different subhects"
+                       "NS_MEDIA and NS_SPECIAL are different subject namespaces"
                );
                $this->assertDifferentSubject(
                        NS_SPECIAL, NS_MEDIA,
-                       "NS_SPECIAL and NS_MEDIA are different subhects"
+                       "NS_SPECIAL and NS_MEDIA are different subject namespaces"
                );
 
        }
@@ -422,7 +418,7 @@ class MWNamespaceTest extends MediaWikiTestCase {
                $this->assertEquals(
                        array( NS_MAIN, NS_USER, NS_CATEGORY ),
                        MWNamespace::getcontentNamespaces(),
-                       'NS_MAIN is forced in wgContentNamespaces even if unwanted'
+                       'NS_MAIN is forced in $wgContentNamespaces even if unwanted'
                );
 
                # test other cases, return $wgcontentNamespaces as is
@@ -550,6 +546,15 @@ class MWNamespaceTest extends MediaWikiTestCase {
 
        }
 
+       public function testIsNonincludable() {
+               global $wgNonincludableNamespaces;
+               $wgNonincludableNamespaces = array( NS_USER );
+
+               $this->assertTrue( MWNamespace::isNonincludable( NS_USER ) );
+
+               $this->assertFalse( MWNamespace::isNonincludable( NS_TEMPLATE ) );
+       }
+
        ####### HELPERS ###########################################################
        function __call( $method, $args ) {
                // Call the real method if it exists