r95439 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95438‎ | r95439 | r95440 >
Date:20:14, 24 August 2011
Author:reedy
Status:resolved
Tags:
Comment:
Fixup the rest of r82577
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/MWNamespaceTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/MWNamespaceTest.php
@@ -219,14 +219,45 @@
220220 // and per function definition.
221221 $this->assertTrue( MWNamespace::isContent( NS_MAIN ) );
222222
 223+ global $wgContentNamespaces;
 224+
 225+ $saved = $wgContentNamespaces;
 226+
 227+ $wgContentNamespaces[] = NS_MAIN;
 228+ $this->assertTrue( MWNamespace::isContent( NS_MAIN ) );
 229+
223230 // Other namespaces which are not expected to be content
224 - $this->assertFalse( MWNamespace::isContent( NS_MEDIA ) );
225 - $this->assertFalse( MWNamespace::isContent( NS_SPECIAL ) );
226 - $this->assertFalse( MWNamespace::isContent( NS_TALK ) );
227 - $this->assertFalse( MWNamespace::isContent( NS_USER ) );
 231+ if ( isset( $wgContentNamespaces[NS_MEDIA] ) ) {
 232+ unset( $wgContentNamespaces[NS_MEDIA] );
 233+ }
 234+ $this->assertFalse( MWNamespace::isContent( NS_MEDIA ) );
 235+
 236+ if ( isset( $wgContentNamespaces[NS_SPECIAL] ) ) {
 237+ unset( $wgContentNamespaces[NS_SPECIAL] );
 238+ }
 239+ $this->assertFalse( MWNamespace::isContent( NS_SPECIAL ) );
 240+
 241+ if ( isset( $wgContentNamespaces[NS_TALK] ) ) {
 242+ unset( $wgContentNamespaces[NS_TALK] );
 243+ }
 244+ $this->assertFalse( MWNamespace::isContent( NS_TALK ) );
 245+
 246+ if ( isset( $wgContentNamespaces[NS_USER] ) ) {
 247+ unset( $wgContentNamespaces[NS_USER] );
 248+ }
 249+ $this->assertFalse( MWNamespace::isContent( NS_USER ) );
 250+
 251+ if ( isset( $wgContentNamespaces[NS_CATEGORY] ) ) {
 252+ unset( $wgContentNamespaces[NS_CATEGORY] );
 253+ }
228254 $this->assertFalse( MWNamespace::isContent( NS_CATEGORY ) );
229 - // User defined namespace:
 255+
 256+ if ( isset( $wgContentNamespaces[100] ) ) {
 257+ unset( $wgContentNamespaces[100] );
 258+ }
230259 $this->assertFalse( MWNamespace::isContent( 100 ) );
 260+
 261+ $wgContentNamespaces = saved;
231262 }
232263
233264 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r95440Fix missing $ from r95439reedy20:15, 24 August 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r82577improve namespace related methods...hashar22:17, 21 February 2011

Status & tagging log