jenkins-bot has submitted this change and it was merged.

Change subject: Fixed return type of getContentNamespaces()
......................................................................


Fixed return type of getContentNamespaces()

Change-Id: I3e1717c3a7b3f9d7fa7fd823b5d3143a679b0d3d
---
M includes/Namespace.php
M tests/phpunit/includes/MWNamespaceTest.php
2 files changed, 6 insertions(+), 6 deletions(-)

Approvals:
  Parent5446: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Namespace.php b/includes/Namespace.php
index 8001b41..5c8e63b 100644
--- a/includes/Namespace.php
+++ b/includes/Namespace.php
@@ -334,7 +334,7 @@
        public static function getContentNamespaces() {
                global $wgContentNamespaces;
                if ( !is_array( $wgContentNamespaces ) || $wgContentNamespaces 
=== array() ) {
-                       return NS_MAIN;
+                       return array( NS_MAIN );
                } elseif ( !in_array( NS_MAIN, $wgContentNamespaces ) ) {
                        // always force NS_MAIN to be part of array (to match 
the algorithm used by isContent)
                        return array_merge( array( NS_MAIN ), 
$wgContentNamespaces );
diff --git a/tests/phpunit/includes/MWNamespaceTest.php 
b/tests/phpunit/includes/MWNamespaceTest.php
index 7d6d5a1..10e9db6 100644
--- a/tests/phpunit/includes/MWNamespaceTest.php
+++ b/tests/phpunit/includes/MWNamespaceTest.php
@@ -350,20 +350,20 @@
 
                # test !is_array( $wgcontentNamespaces )
                $wgContentNamespaces = '';
-               $this->assertEquals( NS_MAIN, 
MWNamespace::getContentNamespaces() );
+               $this->assertEquals( array( NS_MAIN ), 
MWNamespace::getContentNamespaces() );
 
                $wgContentNamespaces = false;
-               $this->assertEquals( NS_MAIN, 
MWNamespace::getContentNamespaces() );
+               $this->assertEquals( array( NS_MAIN ), 
MWNamespace::getContentNamespaces() );
 
                $wgContentNamespaces = null;
-               $this->assertEquals( NS_MAIN, 
MWNamespace::getContentNamespaces() );
+               $this->assertEquals( array( NS_MAIN ), 
MWNamespace::getContentNamespaces() );
 
                $wgContentNamespaces = 5;
-               $this->assertEquals( NS_MAIN, 
MWNamespace::getContentNamespaces() );
+               $this->assertEquals( array( NS_MAIN ), 
MWNamespace::getContentNamespaces() );
 
                # test $wgContentNamespaces === array()
                $wgContentNamespaces = array();
-               $this->assertEquals( NS_MAIN, 
MWNamespace::getContentNamespaces() );
+               $this->assertEquals( array( NS_MAIN ), 
MWNamespace::getContentNamespaces() );
 
                # test !in_array( NS_MAIN, $wgContentNamespaces )
                $wgContentNamespaces = array( NS_USER, NS_CATEGORY );

-- 
To view, visit https://gerrit.wikimedia.org/r/72111
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3e1717c3a7b3f9d7fa7fd823b5d3143a679b0d3d
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to