MediaWiki  REL1_19
MWNamespaceTest Class Reference

Test class for MWNamespace. More...

Inheritance diagram for MWNamespaceTest:
Collaboration diagram for MWNamespaceTest:

List of all members.

Public Member Functions

 __call ($method, $args)
 assertDifferentSubject ($ns1, $ns2, $msg= '')
 assertSameSubject ($ns1, $ns2, $msg= '')
 testCanTalk ()
 testEquals ()
 Test MWNamespace::equals Note if we add a namespace registration system with keys like 'MAIN' we should add tests here for equivilance on things like 'MAIN' == 0 and 'MAIN' == NS_MAIN.
 testGetAssociated ()
 Regular getAssociated() calls Namespaces without an associated page (NS_MEDIA, NS_SPECIAL) are tested in the function testGetAssociatedExceptions()
 testGetAssociatedExceptionsForNsMedia ()
 MWException
 testGetAssociatedExceptionsForNsSpecial ()
 MWException
 testGetContentNamespaces ()
 testGetSubject ()
 testGetTalk ()
 Regular getTalk() calls Namespaces without a talk page (NS_MEDIA, NS_SPECIAL) are tested in the function testGetTalkExceptions()
 testGetTalkExceptionsForNsMedia ()
 Exceptions with getTalk() NS_MEDIA does not have talk pages.
 testGetTalkExceptionsForNsSpecial ()
 Exceptions with getTalk() NS_SPECIAL does not have talk pages.
 testHasGenderDistinction ()
 testHasSubpages ()
 testIsCapitalizedHardcodedAssertions ()
 Some namespaces are always capitalized per code definition in MWNamespace::$alwaysCapitalizedNamespaces.
 testIsCapitalizedWithWgCapitalLinkOverrides ()
 Counter part for MWNamespace::testIsCapitalizedWithWgCapitalLinks() now testing the $wgCapitalLinkOverrides global.
 testIsCapitalizedWithWgCapitalLinks ()
 Follows up for testIsCapitalizedHardcodedAssertions() but alter the global $wgCapitalLink setting to have extended coverage.
 testIsContent ()
 testIsContentWithAdditionsInWgContentNamespaces ()
 Similar to testIsContent() but alters the $wgContentNamespaces global variable.
 testIsMovable ()
 testIsSubject ()
 Please make sure to change testIsTalk() if you change the assertions below.
 testIsTalk ()
 Reverse of testIsSubject().
 testIsWatchable ()
 testSpecialAndMediaAreDifferentSubjects ()
 testSubjectEquals ()
 Test MWNamespace::subjectEquals.

Protected Member Functions

 setUp ()
 Sets up the fixture, for example, opens a network connection.
 tearDown ()
 Tears down the fixture, for example, closes a network connection.

Detailed Description

Test class for MWNamespace.

Generated by PHPUnit on 2011-02-20 at 21:01:55.

Definition at line 13 of file MWNamespaceTest.php.


Member Function Documentation

MWNamespaceTest::__call ( method,
args 
)

Reimplemented from MediaWikiTestCase.

Definition at line 554 of file MWNamespaceTest.php.

References MWNamespace\getCanonicalName().

Here is the call graph for this function:

MWNamespaceTest::assertDifferentSubject ( ns1,
ns2,
msg = '' 
)

Definition at line 589 of file MWNamespaceTest.php.

References MWNamespace\subjectEquals().

Referenced by testSpecialAndMediaAreDifferentSubjects(), and testSubjectEquals().

Here is the call graph for this function:

Here is the caller graph for this function:

MWNamespaceTest::assertSameSubject ( ns1,
ns2,
msg = '' 
)

Definition at line 586 of file MWNamespaceTest.php.

References MWNamespace\subjectEquals().

Referenced by testSubjectEquals().

Here is the call graph for this function:

Here is the caller graph for this function:

MWNamespaceTest::setUp ( ) [protected]

Sets up the fixture, for example, opens a network connection.

This method is called before a test is executed.

Definition at line 18 of file MWNamespaceTest.php.

MWNamespaceTest::tearDown ( ) [protected]

Tears down the fixture, for example, closes a network connection.

This method is called after a test is executed.

Definition at line 25 of file MWNamespaceTest.php.

Todo:
Implement testGetCanonicalNamespaces().
Todo:
Implement testGetCanonicalName().
Todo:
Implement testGetCanonicalIndex().
Todo:
Implement testGetValidNamespaces().

Definition at line 256 of file MWNamespaceTest.php.

Test MWNamespace::equals Note if we add a namespace registration system with keys like 'MAIN' we should add tests here for equivilance on things like 'MAIN' == 0 and 'MAIN' == NS_MAIN.

Todo:
Implement testExists().

Definition at line 169 of file MWNamespaceTest.php.

References MWNamespace\equals().

Here is the call graph for this function:

Regular getAssociated() calls Namespaces without an associated page (NS_MEDIA, NS_SPECIAL) are tested in the function testGetAssociatedExceptions()

Definition at line 128 of file MWNamespaceTest.php.

References MWNamespace\getAssociated().

Here is the call graph for this function:

MWException

Definition at line 140 of file MWNamespaceTest.php.

References MWNamespace\getAssociated().

Here is the call graph for this function:

MWException

Definition at line 147 of file MWNamespaceTest.php.

References MWNamespace\getAssociated().

Here is the call graph for this function:

Definition at line 84 of file MWNamespaceTest.php.

References MWNamespace\getSubject().

Here is the call graph for this function:

Regular getTalk() calls Namespaces without a talk page (NS_MEDIA, NS_SPECIAL) are tested in the function testGetTalkExceptions()

Definition at line 98 of file MWNamespaceTest.php.

References MWNamespace\getTalk().

Here is the call graph for this function:

Exceptions with getTalk() NS_MEDIA does not have talk pages.

MediaWiki raise an exception for them. MWException

Definition at line 110 of file MWNamespaceTest.php.

References MWNamespace\getTalk().

Here is the call graph for this function:

Exceptions with getTalk() NS_SPECIAL does not have talk pages.

MediaWiki raise an exception for them. MWException

Definition at line 119 of file MWNamespaceTest.php.

References MWNamespace\getTalk().

Here is the call graph for this function:

Definition at line 540 of file MWNamespaceTest.php.

References MWNamespace\hasGenderDistinction().

Here is the call graph for this function:

Some namespaces are always capitalized per code definition in MWNamespace::$alwaysCapitalizedNamespaces.

Definition at line 448 of file MWNamespaceTest.php.

References MWNamespace\isCapitalized().

Here is the call graph for this function:

Counter part for MWNamespace::testIsCapitalizedWithWgCapitalLinks() now testing the $wgCapitalLinkOverrides global.

Todo:
split groups of assertions in autonomous testing functions

Definition at line 507 of file MWNamespaceTest.php.

References $wgCapitalLinkOverrides.

Follows up for testIsCapitalizedHardcodedAssertions() but alter the global $wgCapitalLink setting to have extended coverage.

MWNamespace::isCapitalized() rely on two global settings: $wgCapitalLinkOverrides = array(); by default $wgCapitalLinks = true; by default This function test $wgCapitalLinks

Global setting correctness is tested against the NS_PROJECT and NS_PROJECT_TALK namespaces since they are not hardcoded nor specials

Definition at line 479 of file MWNamespaceTest.php.

References $wgCapitalLinks.

Definition at line 272 of file MWNamespaceTest.php.

References $wgContentNamespaces.

Similar to testIsContent() but alters the $wgContentNamespaces global variable.

Definition at line 322 of file MWNamespaceTest.php.

References $wgContentNamespaces.

Todo:
Write more texts, handle $wgAllowImageMoving setting

Definition at line 34 of file MWNamespaceTest.php.

References MWNamespace\isMovable().

Here is the call graph for this function:

Please make sure to change testIsTalk() if you change the assertions below.

Definition at line 42 of file MWNamespaceTest.php.

References MWNamespace\isMain(), and MWNamespace\isSubject().

Here is the call graph for this function:

Reverse of testIsSubject().

Please update testIsSubject() if you change assertions below

Definition at line 66 of file MWNamespaceTest.php.

Definition at line 348 of file MWNamespaceTest.php.

Definition at line 198 of file MWNamespaceTest.php.

References assertDifferentSubject().

Here is the call graph for this function:

Test MWNamespace::subjectEquals.

Definition at line 184 of file MWNamespaceTest.php.

References assertDifferentSubject(), and assertSameSubject().

Here is the call graph for this function:


The documentation for this class was generated from the following file: