| Index: trunk/phase3/tests/phpunit/includes/MWNamespaceTest.php |
| — | — | @@ -219,14 +219,45 @@ |
| 220 | 220 | // and per function definition. |
| 221 | 221 | $this->assertTrue( MWNamespace::isContent( NS_MAIN ) ); |
| 222 | 222 | |
| | 223 | + global $wgContentNamespaces; |
| | 224 | + |
| | 225 | + $saved = $wgContentNamespaces; |
| | 226 | + |
| | 227 | + $wgContentNamespaces[] = NS_MAIN; |
| | 228 | + $this->assertTrue( MWNamespace::isContent( NS_MAIN ) ); |
| | 229 | + |
| 223 | 230 | // 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 | + } |
| 228 | 254 | $this->assertFalse( MWNamespace::isContent( NS_CATEGORY ) ); |
| 229 | | - // User defined namespace: |
| | 255 | + |
| | 256 | + if ( isset( $wgContentNamespaces[100] ) ) { |
| | 257 | + unset( $wgContentNamespaces[100] ); |
| | 258 | + } |
| 230 | 259 | $this->assertFalse( MWNamespace::isContent( 100 ) ); |
| | 260 | + |
| | 261 | + $wgContentNamespaces = saved; |
| 231 | 262 | } |
| 232 | 263 | |
| 233 | 264 | /** |