MediaWiki  1.23.8
MWNamespaceTest.php
Go to the documentation of this file.
1 <?php
16  protected function setUp() {
17  parent::setUp();
18 
19  $this->setMwGlobals( array(
20  'wgContentNamespaces' => array( NS_MAIN ),
21  'wgNamespacesWithSubpages' => array(
22  NS_TALK => true,
23  NS_USER => true,
24  NS_USER_TALK => true,
25  ),
26  'wgCapitalLinks' => true,
27  'wgCapitalLinkOverrides' => array(),
28  'wgNonincludableNamespaces' => array(),
29  ) );
30  }
31 
32 #### START OF TESTS #########################################################
33 
38  public function testIsMovable() {
39  $this->assertFalse( MWNamespace::isMovable( NS_CATEGORY ) );
40  # @todo FIXME: Write more tests!!
41  }
42 
47  public function testIsSubject() {
48  // Special namespaces
49  $this->assertIsSubject( NS_MEDIA );
50  $this->assertIsSubject( NS_SPECIAL );
51 
52  // Subject pages
53  $this->assertIsSubject( NS_MAIN );
54  $this->assertIsSubject( NS_USER );
55  $this->assertIsSubject( 100 ); # user defined
56 
57  // Talk pages
58  $this->assertIsNotSubject( NS_TALK );
59  $this->assertIsNotSubject( NS_USER_TALK );
60  $this->assertIsNotSubject( 101 ); # user defined
61  }
62 
68  public function testIsTalk() {
69  // Special namespaces
70  $this->assertIsNotTalk( NS_MEDIA );
71  $this->assertIsNotTalk( NS_SPECIAL );
72 
73  // Subject pages
74  $this->assertIsNotTalk( NS_MAIN );
75  $this->assertIsNotTalk( NS_USER );
76  $this->assertIsNotTalk( 100 ); # user defined
77 
78  // Talk pages
79  $this->assertIsTalk( NS_TALK );
80  $this->assertIsTalk( NS_USER_TALK );
81  $this->assertIsTalk( 101 ); # user defined
82  }
83 
87  public function testGetSubject() {
88  // Special namespaces are their own subjects
89  $this->assertEquals( NS_MEDIA, MWNamespace::getSubject( NS_MEDIA ) );
90  $this->assertEquals( NS_SPECIAL, MWNamespace::getSubject( NS_SPECIAL ) );
91 
92  $this->assertEquals( NS_MAIN, MWNamespace::getSubject( NS_TALK ) );
93  $this->assertEquals( NS_USER, MWNamespace::getSubject( NS_USER_TALK ) );
94  }
95 
102  public function testGetTalk() {
103  $this->assertEquals( NS_TALK, MWNamespace::getTalk( NS_MAIN ) );
104  $this->assertEquals( NS_TALK, MWNamespace::getTalk( NS_TALK ) );
105  $this->assertEquals( NS_USER_TALK, MWNamespace::getTalk( NS_USER ) );
106  $this->assertEquals( NS_USER_TALK, MWNamespace::getTalk( NS_USER_TALK ) );
107  }
108 
116  $this->assertNull( MWNamespace::getTalk( NS_MEDIA ) );
117  }
118 
126  $this->assertNull( MWNamespace::getTalk( NS_SPECIAL ) );
127  }
128 
135  public function testGetAssociated() {
136  $this->assertEquals( NS_TALK, MWNamespace::getAssociated( NS_MAIN ) );
137  $this->assertEquals( NS_MAIN, MWNamespace::getAssociated( NS_TALK ) );
138  }
139 
140  ### Exceptions with getAssociated()
141  ### NS_MEDIA and NS_SPECIAL do not have talk pages. MediaWiki raises
142  ### an exception for them.
143 
148  $this->assertNull( MWNamespace::getAssociated( NS_MEDIA ) );
149  }
150 
156  $this->assertNull( MWNamespace::getAssociated( NS_SPECIAL ) );
157  }
158 
162  /*
163  public function testExists() {
164  // Remove the following lines when you implement this test.
165  $this->markTestIncomplete(
166  'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.'
167  );
168  }
169  */
170 
178  public function testEquals() {
179  $this->assertTrue( MWNamespace::equals( NS_MAIN, NS_MAIN ) );
180  $this->assertTrue( MWNamespace::equals( NS_MAIN, 0 ) ); // In case we make NS_MAIN 'MAIN'
181  $this->assertTrue( MWNamespace::equals( NS_USER, NS_USER ) );
182  $this->assertTrue( MWNamespace::equals( NS_USER, 2 ) );
183  $this->assertTrue( MWNamespace::equals( NS_USER_TALK, NS_USER_TALK ) );
184  $this->assertTrue( MWNamespace::equals( NS_SPECIAL, NS_SPECIAL ) );
185  $this->assertFalse( MWNamespace::equals( NS_MAIN, NS_TALK ) );
186  $this->assertFalse( MWNamespace::equals( NS_USER, NS_USER_TALK ) );
187  $this->assertFalse( MWNamespace::equals( NS_PROJECT, NS_TEMPLATE ) );
188  }
189 
193  public function testSubjectEquals() {
194  $this->assertSameSubject( NS_MAIN, NS_MAIN );
195  $this->assertSameSubject( NS_MAIN, 0 ); // In case we make NS_MAIN 'MAIN'
196  $this->assertSameSubject( NS_USER, NS_USER );
197  $this->assertSameSubject( NS_USER, 2 );
200  $this->assertSameSubject( NS_MAIN, NS_TALK );
202 
205  }
206 
211  $this->assertDifferentSubject(
213  "NS_MEDIA and NS_SPECIAL are different subject namespaces"
214  );
215  $this->assertDifferentSubject(
217  "NS_SPECIAL and NS_MEDIA are different subject namespaces"
218  );
219  }
220 
224  /*
225  public function testGetCanonicalNamespaces() {
226  // Remove the following lines when you implement this test.
227  $this->markTestIncomplete(
228  'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.'
229  );
230  }
231  */
235  /*
236  public function testGetCanonicalName() {
237  // Remove the following lines when you implement this test.
238  $this->markTestIncomplete(
239  'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.'
240  );
241  }
242  */
246  /*
247  public function testGetCanonicalIndex() {
248  // Remove the following lines when you implement this test.
249  $this->markTestIncomplete(
250  'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.'
251  );
252  }
253  */
254 
258  /*
259  public function testGetValidNamespaces() {
260  // Remove the following lines when you implement this test.
261  $this->markTestIncomplete(
262  'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.'
263  );
264  }
265  */
266 
270  public function testCanTalk() {
271  $this->assertCanNotTalk( NS_MEDIA );
272  $this->assertCanNotTalk( NS_SPECIAL );
273 
274  $this->assertCanTalk( NS_MAIN );
275  $this->assertCanTalk( NS_TALK );
276  $this->assertCanTalk( NS_USER );
277  $this->assertCanTalk( NS_USER_TALK );
278 
279  // User defined namespaces
280  $this->assertCanTalk( 100 );
281  $this->assertCanTalk( 101 );
282  }
283 
287  public function testIsContent() {
288  // NS_MAIN is a content namespace per DefaultSettings.php
289  // and per function definition.
290 
291  $this->assertIsContent( NS_MAIN );
292 
293  // Other namespaces which are not expected to be content
294 
295  $this->assertIsNotContent( NS_MEDIA );
296  $this->assertIsNotContent( NS_SPECIAL );
297  $this->assertIsNotContent( NS_TALK );
298  $this->assertIsNotContent( NS_USER );
299  $this->assertIsNotContent( NS_CATEGORY );
300  $this->assertIsNotContent( 100 );
301  }
302 
308  public function testIsContentAdvanced() {
309  global $wgContentNamespaces;
310 
311  // Test that user defined namespace #252 is not content
312  $this->assertIsNotContent( 252 );
313 
314  // Bless namespace # 252 as a content namespace
315  $wgContentNamespaces[] = 252;
316 
317  $this->assertIsContent( 252 );
318 
319  // Makes sure NS_MAIN was not impacted
320  $this->assertIsContent( NS_MAIN );
321  }
322 
326  public function testIsWatchable() {
327  // Specials namespaces are not watchable
328  $this->assertIsNotWatchable( NS_MEDIA );
329  $this->assertIsNotWatchable( NS_SPECIAL );
330 
331  // Core defined namespaces are watchables
332  $this->assertIsWatchable( NS_MAIN );
333  $this->assertIsWatchable( NS_TALK );
334 
335  // Additional, user defined namespaces are watchables
336  $this->assertIsWatchable( 100 );
337  $this->assertIsWatchable( 101 );
338  }
339 
343  public function testHasSubpages() {
344  global $wgNamespacesWithSubpages;
345 
346  // Special namespaces:
347  $this->assertHasNotSubpages( NS_MEDIA );
348  $this->assertHasNotSubpages( NS_SPECIAL );
349 
350  // Namespaces without subpages
351  $this->assertHasNotSubpages( NS_MAIN );
352 
353  $wgNamespacesWithSubpages[NS_MAIN] = true;
354  $this->assertHasSubpages( NS_MAIN );
355 
356  $wgNamespacesWithSubpages[NS_MAIN] = false;
357  $this->assertHasNotSubpages( NS_MAIN );
358 
359  // Some namespaces with subpages
360  $this->assertHasSubpages( NS_TALK );
361  $this->assertHasSubpages( NS_USER );
362  $this->assertHasSubpages( NS_USER_TALK );
363  }
364 
368  public function testGetContentNamespaces() {
369  global $wgContentNamespaces;
370 
371  $this->assertEquals(
372  array( NS_MAIN ),
374  '$wgContentNamespaces is an array with only NS_MAIN by default'
375  );
376 
377  # test !is_array( $wgcontentNamespaces )
378  $wgContentNamespaces = '';
379  $this->assertEquals( array( NS_MAIN ), MWNamespace::getContentNamespaces() );
380 
381  $wgContentNamespaces = false;
382  $this->assertEquals( array( NS_MAIN ), MWNamespace::getContentNamespaces() );
383 
384  $wgContentNamespaces = null;
385  $this->assertEquals( array( NS_MAIN ), MWNamespace::getContentNamespaces() );
386 
387  $wgContentNamespaces = 5;
388  $this->assertEquals( array( NS_MAIN ), MWNamespace::getContentNamespaces() );
389 
390  # test $wgContentNamespaces === array()
391  $wgContentNamespaces = array();
392  $this->assertEquals( array( NS_MAIN ), MWNamespace::getContentNamespaces() );
393 
394  # test !in_array( NS_MAIN, $wgContentNamespaces )
395  $wgContentNamespaces = array( NS_USER, NS_CATEGORY );
396  $this->assertEquals(
399  'NS_MAIN is forced in $wgContentNamespaces even if unwanted'
400  );
401 
402  # test other cases, return $wgcontentNamespaces as is
403  $wgContentNamespaces = array( NS_MAIN );
404  $this->assertEquals(
405  array( NS_MAIN ),
407  );
408 
409  $wgContentNamespaces = array( NS_MAIN, NS_USER, NS_CATEGORY );
410  $this->assertEquals(
413  );
414  }
415 
419  public function testGetSubjectNamespaces() {
420  $subjectsNS = MWNamespace::getSubjectNamespaces();
421  $this->assertContains( NS_MAIN, $subjectsNS,
422  "Talk namespaces should have NS_MAIN" );
423  $this->assertNotContains( NS_TALK, $subjectsNS,
424  "Talk namespaces should have NS_TALK" );
425 
426  $this->assertNotContains( NS_MEDIA, $subjectsNS,
427  "Talk namespaces should not have NS_MEDIA" );
428  $this->assertNotContains( NS_SPECIAL, $subjectsNS,
429  "Talk namespaces should not have NS_SPECIAL" );
430  }
431 
435  public function testGetTalkNamespaces() {
436  $talkNS = MWNamespace::getTalkNamespaces();
437  $this->assertContains( NS_TALK, $talkNS,
438  "Subject namespaces should have NS_TALK" );
439  $this->assertNotContains( NS_MAIN, $talkNS,
440  "Subject namespaces should not have NS_MAIN" );
441 
442  $this->assertNotContains( NS_MEDIA, $talkNS,
443  "Subject namespaces should not have NS_MEDIA" );
444  $this->assertNotContains( NS_SPECIAL, $talkNS,
445  "Subject namespaces should not have NS_SPECIAL" );
446  }
447 
454  // NS_MEDIA and NS_FILE are treated the same
455  $this->assertEquals(
458  'NS_MEDIA and NS_FILE have same capitalization rendering'
459  );
460 
461  // Boths are capitalized by default
462  $this->assertIsCapitalized( NS_MEDIA );
463  $this->assertIsCapitalized( NS_FILE );
464 
465  // Always capitalized namespaces
466  // @see MWNamespace::$alwaysCapitalizedNamespaces
467  $this->assertIsCapitalized( NS_SPECIAL );
468  $this->assertIsCapitalized( NS_USER );
469  $this->assertIsCapitalized( NS_MEDIAWIKI );
470  }
471 
486  global $wgCapitalLinks;
487 
488  $this->assertIsCapitalized( NS_PROJECT );
489  $this->assertIsCapitalized( NS_PROJECT_TALK );
490 
491  $wgCapitalLinks = false;
492 
493  // hardcoded namespaces (see above function) are still capitalized:
494  $this->assertIsCapitalized( NS_SPECIAL );
495  $this->assertIsCapitalized( NS_USER );
496  $this->assertIsCapitalized( NS_MEDIAWIKI );
497 
498  // setting is correctly applied
499  $this->assertIsNotCapitalized( NS_PROJECT );
500  $this->assertIsNotCapitalized( NS_PROJECT_TALK );
501  }
502 
511  global $wgCapitalLinkOverrides;
512 
513  // Test default settings
514  $this->assertIsCapitalized( NS_PROJECT );
515  $this->assertIsCapitalized( NS_PROJECT_TALK );
516 
517  // hardcoded namespaces (see above function) are capitalized:
518  $this->assertIsCapitalized( NS_SPECIAL );
519  $this->assertIsCapitalized( NS_USER );
520  $this->assertIsCapitalized( NS_MEDIAWIKI );
521 
522  // Hardcoded namespaces remains capitalized
523  $wgCapitalLinkOverrides[NS_SPECIAL] = false;
524  $wgCapitalLinkOverrides[NS_USER] = false;
525  $wgCapitalLinkOverrides[NS_MEDIAWIKI] = false;
526 
527  $this->assertIsCapitalized( NS_SPECIAL );
528  $this->assertIsCapitalized( NS_USER );
529  $this->assertIsCapitalized( NS_MEDIAWIKI );
530 
531  $wgCapitalLinkOverrides[NS_PROJECT] = false;
532  $this->assertIsNotCapitalized( NS_PROJECT );
533 
534  $wgCapitalLinkOverrides[NS_PROJECT] = true;
535  $this->assertIsCapitalized( NS_PROJECT );
536 
537  unset( $wgCapitalLinkOverrides[NS_PROJECT] );
538  $this->assertIsCapitalized( NS_PROJECT );
539  }
540 
544  public function testHasGenderDistinction() {
545  // Namespaces with gender distinctions
546  $this->assertTrue( MWNamespace::hasGenderDistinction( NS_USER ) );
547  $this->assertTrue( MWNamespace::hasGenderDistinction( NS_USER_TALK ) );
548 
549  // Other ones, "genderless"
550  $this->assertFalse( MWNamespace::hasGenderDistinction( NS_MEDIA ) );
551  $this->assertFalse( MWNamespace::hasGenderDistinction( NS_SPECIAL ) );
552  $this->assertFalse( MWNamespace::hasGenderDistinction( NS_MAIN ) );
553  $this->assertFalse( MWNamespace::hasGenderDistinction( NS_TALK ) );
554  }
555 
559  public function testIsNonincludable() {
560  global $wgNonincludableNamespaces;
561 
562  $wgNonincludableNamespaces = array( NS_USER );
563 
564  $this->assertTrue( MWNamespace::isNonincludable( NS_USER ) );
565  $this->assertFalse( MWNamespace::isNonincludable( NS_TEMPLATE ) );
566  }
567 
568  ####### HELPERS ###########################################################
569  function __call( $method, $args ) {
570  // Call the real method if it exists
571  if ( method_exists( $this, $method ) ) {
572  return $this->$method( $args );
573  }
574 
575  if ( preg_match( '/^assert(Has|Is|Can)(Not|)(Subject|Talk|Watchable|Content|Subpages|Capitalized)$/', $method, $m ) ) {
576  # Interprets arguments:
577  $ns = $args[0];
578  $msg = isset( $args[1] ) ? $args[1] : " dummy message";
579 
580  # Forge the namespace constant name:
581  if ( $ns === 0 ) {
582  $ns_name = "NS_MAIN";
583  } else {
584  $ns_name = "NS_" . strtoupper( MWNamespace::getCanonicalName( $ns ) );
585  }
586  # ... and the MWNamespace method name
587  $nsMethod = strtolower( $m[1] ) . $m[3];
588 
589  $expect = ( $m[2] === '' );
590  $expect_name = $expect ? 'TRUE' : 'FALSE';
591 
592  return $this->assertEquals( $expect,
593  MWNamespace::$nsMethod( $ns, $msg ),
594  "MWNamespace::$nsMethod( $ns_name ) should returns $expect_name"
595  );
596  }
597 
598  throw new Exception( __METHOD__ . " could not find a method named $method\n" );
599  }
600 
601  function assertSameSubject( $ns1, $ns2, $msg = '' ) {
602  $this->assertTrue( MWNamespace::subjectEquals( $ns1, $ns2, $msg ) );
603  }
604 
605  function assertDifferentSubject( $ns1, $ns2, $msg = '' ) {
606  $this->assertFalse( MWNamespace::subjectEquals( $ns1, $ns2, $msg ) );
607  }
608 }
MWNamespaceTest\testIsContentAdvanced
testIsContentAdvanced()
Similar to testIsContent() but alters the $wgContentNamespaces global variable.
Definition: MWNamespaceTest.php:308
MWNamespaceTest\testSubjectEquals
testSubjectEquals()
@covers MWNamespace::subjectEquals
Definition: MWNamespaceTest.php:193
MWNamespace\subjectEquals
static subjectEquals( $ns1, $ns2)
Returns whether the specified namespaces share the same subject.
Definition: Namespace.php:205
MWNamespace\isNonincludable
static isNonincludable( $index)
It is not possible to use pages from this namespace as template?
Definition: Namespace.php:417
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
MWNamespaceTest\assertDifferentSubject
assertDifferentSubject( $ns1, $ns2, $msg='')
Definition: MWNamespaceTest.php:605
MWNamespace\hasGenderDistinction
static hasGenderDistinction( $index)
Does the namespace (potentially) have different aliases for different genders.
Definition: Namespace.php:406
MWNamespace\getTalkNamespaces
static getTalkNamespaces()
List all namespace indices which are considered talks, aka not a subject or special namespace.
Definition: Namespace.php:365
MWNamespaceTest\setUp
setUp()
Definition: MWNamespaceTest.php:16
MWNamespaceTest\testGetSubjectNamespaces
testGetSubjectNamespaces()
@covers MWNamespace::getSubjectNamespaces
Definition: MWNamespaceTest.php:419
MWNamespaceTest\testGetAssociated
testGetAssociated()
Regular getAssociated() calls Namespaces without an associated page (NS_MEDIA, NS_SPECIAL) are tested...
Definition: MWNamespaceTest.php:135
MWNamespaceTest\__call
__call( $method, $args)
Definition: MWNamespaceTest.php:569
MWNamespaceTest\testGetContentNamespaces
testGetContentNamespaces()
@covers MWNamespace::getContentNamespaces
Definition: MWNamespaceTest.php:368
MWNamespaceTest\testIsNonincludable
testIsNonincludable()
@covers MWNamespace::isNonincludable
Definition: MWNamespaceTest.php:559
MWNamespaceTest\testIsSubject
testIsSubject()
Please make sure to change testIsTalk() if you change the assertions below @covers MWNamespace::isSub...
Definition: MWNamespaceTest.php:47
NS_FILE
const NS_FILE
Definition: Defines.php:85
NS_TEMPLATE
const NS_TEMPLATE
Definition: Defines.php:89
MWNamespaceTest\testGetSubject
testGetSubject()
@covers MWNamespace::getSubject
Definition: MWNamespaceTest.php:87
MWNamespaceTest\testIsCapitalizedWithWgCapitalLinks
testIsCapitalizedWithWgCapitalLinks()
Follows up for testIsCapitalizedHardcodedAssertions() but alter the global $wgCapitalLink setting to ...
Definition: MWNamespaceTest.php:485
MWNamespace\getSubjectNamespaces
static getSubjectNamespaces()
List all namespace indices which are considered subject, aka not a talk or special namespace.
Definition: Namespace.php:352
MWNamespaceTest\testSpecialAndMediaAreDifferentSubjects
testSpecialAndMediaAreDifferentSubjects()
@covers MWNamespace::subjectEquals
Definition: MWNamespaceTest.php:210
MWNamespace\getContentNamespaces
static getContentNamespaces()
Get a list of all namespace indices which are considered to contain content.
Definition: Namespace.php:334
NS_MAIN
const NS_MAIN
Definition: Defines.php:79
NS_SPECIAL
const NS_SPECIAL
Definition: Defines.php:68
NS_PROJECT
const NS_PROJECT
Definition: Defines.php:83
MWNamespaceTest
Test class for MWNamespace.
Definition: MWNamespaceTest.php:15
MediaWikiTestCase\setMwGlobals
setMwGlobals( $pairs, $value=null)
Definition: MediaWikiTestCase.php:302
MediaWikiTestCase
Definition: MediaWikiTestCase.php:6
MWNamespaceTest\testIsTalk
testIsTalk()
Reverse of testIsSubject().
Definition: MWNamespaceTest.php:68
MWNamespaceTest\testCanTalk
testCanTalk()
@covers MWNamespace::canTalk
Definition: MWNamespaceTest.php:270
MWNamespaceTest\testGetTalkNamespaces
testGetTalkNamespaces()
@covers MWNamespace::getTalkNamespaces
Definition: MWNamespaceTest.php:435
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
MWNamespaceTest\testIsWatchable
testIsWatchable()
@covers MWNamespace::isWatchable
Definition: MWNamespaceTest.php:326
MWNamespace\isMovable
static isMovable( $index)
Can pages in the given namespace be moved?
Definition: Namespace.php:67
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
NS_CATEGORY
const NS_CATEGORY
Definition: Defines.php:93
MWNamespaceTest\assertSameSubject
assertSameSubject( $ns1, $ns2, $msg='')
Definition: MWNamespaceTest.php:601
MWNamespaceTest\testIsMovable
testIsMovable()
Definition: MWNamespaceTest.php:38
MWNamespaceTest\testEquals
testEquals()
Test MWNamespace::equals Note if we add a namespace registration system with keys like 'MAIN' we shou...
Definition: MWNamespaceTest.php:178
NS_USER_TALK
const NS_USER_TALK
Definition: Defines.php:82
user
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such and we might be restricted by PHP settings such as safe mode or open_basedir We cannot assume that the software even has read access anywhere useful Many shared hosts run all users web applications under the same user
Definition: distributors.txt:9
MWNamespaceTest\testGetAssociatedExceptionsForNsMedia
testGetAssociatedExceptionsForNsMedia()
@expectedException MWException @covers MWNamespace::getAssociated
Definition: MWNamespaceTest.php:147
NS_MEDIA
const NS_MEDIA
Definition: Defines.php:67
MWNamespaceTest\testIsCapitalizedHardcodedAssertions
testIsCapitalizedHardcodedAssertions()
Some namespaces are always capitalized per code definition in MWNamespace::$alwaysCapitalizedNamespac...
Definition: MWNamespaceTest.php:453
NS_PROJECT_TALK
const NS_PROJECT_TALK
Definition: Defines.php:84
MWNamespaceTest\testGetTalkExceptionsForNsMedia
testGetTalkExceptionsForNsMedia()
Exceptions with getTalk() NS_MEDIA does not have talk pages.
Definition: MWNamespaceTest.php:115
$args
if( $line===false) $args
Definition: cdb.php:62
MWNamespaceTest\testIsCapitalizedWithWgCapitalLinkOverrides
testIsCapitalizedWithWgCapitalLinkOverrides()
Counter part for MWNamespace::testIsCapitalizedWithWgCapitalLinks() now testing the $wgCapitalLinkOve...
Definition: MWNamespaceTest.php:510
MWNamespaceTest\testGetTalkExceptionsForNsSpecial
testGetTalkExceptionsForNsSpecial()
Exceptions with getTalk() NS_SPECIAL does not have talk pages.
Definition: MWNamespaceTest.php:125
MWNamespace\equals
static equals( $ns1, $ns2)
Returns whether the specified namespaces are the same namespace.
Definition: Namespace.php:190
MWNamespace\isCapitalized
static isCapitalized( $index)
Is the namespace first-letter capitalized?
Definition: Namespace.php:378
NS_USER
const NS_USER
Definition: Defines.php:81
MWNamespaceTest\testHasSubpages
testHasSubpages()
@covers MWNamespace::hasSubpages
Definition: MWNamespaceTest.php:343
NS_TALK
const NS_TALK
Definition: Defines.php:80
NS_MEDIAWIKI
const NS_MEDIAWIKI
Definition: Defines.php:87
MWNamespace\getTalk
static getTalk( $index)
Get the talk namespace index for a given namespace.
Definition: Namespace.php:118
MWNamespaceTest\testGetTalk
testGetTalk()
Regular getTalk() calls Namespaces without a talk page (NS_MEDIA, NS_SPECIAL) are tested in the funct...
Definition: MWNamespaceTest.php:102
MWNamespace\getSubject
static getSubject( $index)
Get the subject namespace index for a given namespace Special namespaces (NS_MEDIA,...
Definition: Namespace.php:132
MWNamespaceTest\testGetAssociatedExceptionsForNsSpecial
testGetAssociatedExceptionsForNsSpecial()
@expectedException MWException @covers MWNamespace::getAssociated
Definition: MWNamespaceTest.php:155
MWNamespaceTest\testIsContent
testIsContent()
@covers MWNamespace::isContent
Definition: MWNamespaceTest.php:287
MWNamespace\getAssociated
static getAssociated( $index)
Get the associated namespace.
Definition: Namespace.php:151
MWNamespace\getCanonicalName
static getCanonicalName( $index)
Returns the canonical (English) name for a given index.
Definition: Namespace.php:237
MWNamespaceTest\testHasGenderDistinction
testHasGenderDistinction()
@covers MWNamespace::hasGenderDistinction
Definition: MWNamespaceTest.php:544