From: Sam Reed Date: Wed, 24 Aug 2011 20:14:03 +0000 (+0000) Subject: Fixup the rest of r82577 X-Git-Tag: 1.31.0-rc.0~28093 X-Git-Url: http://git.cyclocoop.org//%27http:/code.google.com/p/ie7-js//%27?a=commitdiff_plain;h=30dff024244dc68d74db74b9c20b239767c49ab6;p=lhc%2Fweb%2Fwiklou.git Fixup the rest of r82577 --- diff --git a/tests/phpunit/includes/MWNamespaceTest.php b/tests/phpunit/includes/MWNamespaceTest.php index 8b36fe5ecf..b3be3415c7 100644 --- a/tests/phpunit/includes/MWNamespaceTest.php +++ b/tests/phpunit/includes/MWNamespaceTest.php @@ -219,14 +219,45 @@ class MWNamespaceTest extends MediaWikiTestCase { // and per function definition. $this->assertTrue( MWNamespace::isContent( NS_MAIN ) ); + global $wgContentNamespaces; + + $saved = $wgContentNamespaces; + + $wgContentNamespaces[] = NS_MAIN; + $this->assertTrue( MWNamespace::isContent( NS_MAIN ) ); + // Other namespaces which are not expected to be content - $this->assertFalse( MWNamespace::isContent( NS_MEDIA ) ); - $this->assertFalse( MWNamespace::isContent( NS_SPECIAL ) ); - $this->assertFalse( MWNamespace::isContent( NS_TALK ) ); - $this->assertFalse( MWNamespace::isContent( NS_USER ) ); + if ( isset( $wgContentNamespaces[NS_MEDIA] ) ) { + unset( $wgContentNamespaces[NS_MEDIA] ); + } + $this->assertFalse( MWNamespace::isContent( NS_MEDIA ) ); + + if ( isset( $wgContentNamespaces[NS_SPECIAL] ) ) { + unset( $wgContentNamespaces[NS_SPECIAL] ); + } + $this->assertFalse( MWNamespace::isContent( NS_SPECIAL ) ); + + if ( isset( $wgContentNamespaces[NS_TALK] ) ) { + unset( $wgContentNamespaces[NS_TALK] ); + } + $this->assertFalse( MWNamespace::isContent( NS_TALK ) ); + + if ( isset( $wgContentNamespaces[NS_USER] ) ) { + unset( $wgContentNamespaces[NS_USER] ); + } + $this->assertFalse( MWNamespace::isContent( NS_USER ) ); + + if ( isset( $wgContentNamespaces[NS_CATEGORY] ) ) { + unset( $wgContentNamespaces[NS_CATEGORY] ); + } $this->assertFalse( MWNamespace::isContent( NS_CATEGORY ) ); - // User defined namespace: + + if ( isset( $wgContentNamespaces[100] ) ) { + unset( $wgContentNamespaces[100] ); + } $this->assertFalse( MWNamespace::isContent( 100 ) ); + + $wgContentNamespaces = saved; } /**