summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/MWNamespaceTest.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-01-18 16:46:04 +0100
committerPierre Schmitz <pierre@archlinux.de>2013-01-18 16:46:04 +0100
commit63601400e476c6cf43d985f3e7b9864681695ed4 (patch)
treef7846203a952e38aaf66989d0a4702779f549962 /tests/phpunit/includes/MWNamespaceTest.php
parent8ff01378c9e0207f9169b81966a51def645b6a51 (diff)
Update to MediaWiki 1.20.2
this update includes: * adjusted Arch Linux skin * updated FluxBBAuthPlugin * patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024
Diffstat (limited to 'tests/phpunit/includes/MWNamespaceTest.php')
-rw-r--r--tests/phpunit/includes/MWNamespaceTest.php43
1 files changed, 39 insertions, 4 deletions
diff --git a/tests/phpunit/includes/MWNamespaceTest.php b/tests/phpunit/includes/MWNamespaceTest.php
index 6b231fc5..3b05d675 100644
--- a/tests/phpunit/includes/MWNamespaceTest.php
+++ b/tests/phpunit/includes/MWNamespaceTest.php
@@ -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 ) );
}
/**
@@ -442,6 +438,36 @@ class MWNamespaceTest extends MediaWikiTestCase {
}
/**
+ */
+ public function testGetSubjectNamespaces() {
+ $subjectsNS = MWNamespace::getSubjectNamespaces();
+ $this->assertContains( NS_MAIN, $subjectsNS,
+ "Talk namespaces should have NS_MAIN" );
+ $this->assertNotContains( NS_TALK, $subjectsNS,
+ "Talk namespaces should have NS_TALK" );
+
+ $this->assertNotContains( NS_MEDIA, $subjectsNS,
+ "Talk namespaces should not have NS_MEDIA" );
+ $this->assertNotContains( NS_SPECIAL, $subjectsNS,
+ "Talk namespaces should not have NS_SPECIAL" );
+ }
+
+ /**
+ */
+ public function testGetTalkNamespaces() {
+ $talkNS = MWNamespace::getTalkNamespaces();
+ $this->assertContains( NS_TALK, $talkNS,
+ "Subject namespaces should have NS_TALK" );
+ $this->assertNotContains( NS_MAIN, $talkNS,
+ "Subject namespaces should not have NS_MAIN" );
+
+ $this->assertNotContains( NS_MEDIA, $talkNS,
+ "Subject namespaces should not have NS_MEDIA" );
+ $this->assertNotContains( NS_SPECIAL, $talkNS,
+ "Subject namespaces should not have NS_SPECIAL" );
+ }
+
+ /**
* Some namespaces are always capitalized per code definition
* in MWNamespace::$alwaysCapitalizedNamespaces
*/
@@ -550,6 +576,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