MediaWiki  REL1_24
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 ()
 MWNamespace::canTalk
 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() MWNamespace::getAssociated.
 testGetAssociatedExceptionsForNsMedia ()
 MWException MWNamespace::getAssociated
 testGetAssociatedExceptionsForNsSpecial ()
 MWException MWNamespace::getAssociated
 testGetContentNamespaces ()
 MWNamespace::getContentNamespaces
 testGetSubject ()
 MWNamespace::getSubject
 testGetSubjectNamespaces ()
 MWNamespace::getSubjectNamespaces
 testGetTalk ()
 Regular getTalk() calls Namespaces without a talk page (NS_MEDIA, NS_SPECIAL) are tested in the function testGetTalkExceptions() MWNamespace::getTalk.
 testGetTalkExceptionsForNsMedia ()
 Exceptions with getTalk() NS_MEDIA does not have talk pages.
 testGetTalkExceptionsForNsSpecial ()
 Exceptions with getTalk() NS_SPECIAL does not have talk pages.
 testGetTalkNamespaces ()
 MWNamespace::getTalkNamespaces
 testHasGenderDistinction ()
 MWNamespace::hasGenderDistinction
 testHasSubpages ()
 MWNamespace::hasSubpages
 testIsCapitalizedHardcodedAssertions ()
 Some namespaces are always capitalized per code definition in MWNamespace::$alwaysCapitalizedNamespaces MWNamespace::isCapitalized.
 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 ()
 MWNamespace::isContent
 testIsContentAdvanced ()
 Similar to testIsContent() but alters the $wgContentNamespaces global variable.
 testIsMovable ()
 testIsNonincludable ()
 MWNamespace::isNonincludable
 testIsSubject ()
 Please make sure to change testIsTalk() if you change the assertions below MWNamespace::isSubject.
 testIsTalk ()
 Reverse of testIsSubject().
 testIsWatchable ()
 MWNamespace::isWatchable
 testSpecialAndMediaAreDifferentSubjects ()
 MWNamespace::subjectEquals
 testSubjectEquals ()
 MWNamespace::subjectEquals

Protected Member Functions

 setUp ()

Detailed Description

Test class for MWNamespace.

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

Todo:

covers tags

FIXME: this test file is a mess

Definition at line 15 of file MWNamespaceTest.php.


Member Function Documentation

MWNamespaceTest::__call ( func,
args 
)
Since:
1.18
Parameters:
string$func
array$args
Returns:
mixed
Exceptions:
MWException

Reimplemented from MediaWikiTestCase.

Definition at line 569 of file MWNamespaceTest.php.

References MWNamespace\getCanonicalName().

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

Definition at line 605 of file MWNamespaceTest.php.

References MWNamespace\subjectEquals().

Referenced by testSubjectEquals().

MWNamespaceTest::setUp ( ) [protected]

Reimplemented from MediaWikiTestCase.

Definition at line 16 of file MWNamespaceTest.php.

References array(), and MediaWikiTestCase\setMwGlobals().

MWNamespace::canTalk

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

Definition at line 270 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().

MWNamespace::equals

Definition at line 178 of file MWNamespaceTest.php.

References MWNamespace\equals().

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

Definition at line 135 of file MWNamespaceTest.php.

References MWNamespace\getAssociated().

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

Definition at line 102 of file MWNamespaceTest.php.

References MWNamespace\getTalk().

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

MediaWiki raise an exception for them. MWException MWNamespace::getTalk

Definition at line 115 of file MWNamespaceTest.php.

References MWNamespace\getTalk().

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

MediaWiki raise an exception for them. MWException MWNamespace::getTalk

Definition at line 125 of file MWNamespaceTest.php.

References MWNamespace\getTalk().

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

Definition at line 453 of file MWNamespaceTest.php.

References MWNamespace\isCapitalized().

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

Todo:
split groups of assertions in autonomous testing functions MWNamespace::isCapitalized

Definition at line 510 of file MWNamespaceTest.php.

References global.

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 MWNamespace::isCapitalized

Definition at line 485 of file MWNamespaceTest.php.

References global.

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

MWNamespace::isContent

Definition at line 308 of file MWNamespaceTest.php.

References global.

Todo:
Write more texts, handle $wgAllowImageMoving setting MWNamespace::isMovable

Definition at line 38 of file MWNamespaceTest.php.

References MWNamespace\isMovable().

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

Definition at line 47 of file MWNamespaceTest.php.

References user.

Reverse of testIsSubject().

Please update testIsSubject() if you change assertions below MWNamespace::isTalk

Definition at line 68 of file MWNamespaceTest.php.

References user.


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