Implement a number of namespace related equals functions:
authorDaniel Friesen <dantman@users.mediawiki.org>
Tue, 22 Nov 2011 13:34:55 +0000 (13:34 +0000)
committerDaniel Friesen <dantman@users.mediawiki.org>
Tue, 22 Nov 2011 13:34:55 +0000 (13:34 +0000)
commit3414e91bae6012fc75e8ffb0da93c598120c6eed
treee05bd2a3cb00d1fd9c7e58d3f2b508d7f44b6f5a
parent3e35e3bb8ea4987bcef254a4ccad21eea4144bce
Implement a number of namespace related equals functions:
* MWNamespace::equals to test equivalence of two namespaces (forward compatible with any changes we may make like introducing namespace keys like 'USER')
* MWNamespace::subjectEquals to test equivalence of the subject of two namespaces e.g.: MWNamespace::subjectEquals( NS_USER, $ns ); instead of testing for equivalence to both NS_USER and NS_USER_TALK
* Title::inNamespace to use instead of $title->getNamespace() == NS_???
* Title::inNamespaces for use like $title->inNamespaces( NS_USER, NS_PROJECT ) when you only care if it's in one of a number of namespaces (also accepts an array)
* Title::hasSubjectNamespace for use instead of testing for equivalence to both the subject and talk such as NS_USER and NS_USER_TALK.

Include phpunit tests for all this new code, and also add some tests for some existing code.
includes/Namespace.php
includes/Title.php
tests/phpunit/includes/MWNamespaceTest.php
tests/phpunit/includes/TitleMethodsTest.php [new file with mode: 0644]