User "Bawolff" posted a comment on MediaWiki.r82577.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/82577#c18629
Commit summary:

improve namespace related methods

MWNamespace::getTalk() could give erroneus results when using it on specials
namespaces (NS_MEDIA, NS_SPECIAL). It now use MWNamespace::isMethodValidFor()
which will throw an exception if a special namespace was given.

MWNamespace::getSubject() is now returning identity for specials namespaces.

New MWNamespace::getAssociated() used to find out the subject page of a talk
page and vice versa. Special namespaces will results in an exception.


TESTS:

Added tests for almost complete code coverage. Functions relying on global
$wgCanonicalNamespaces are still incomplete though.
MWNamespace::isMovable() needs more assertions.

Tests results (ignoring incomplete tests output):

$ php phpunit.php --filter MWNamespace
PHPUnit 3.5.10 by Sebastian Bergmann.

.........IIIII..........

Time: 1 second, Memory: 31.75Mb

OK, but incomplete or skipped tests!
Tests: 24, Assertions: 99, Incomplete: 5.

Comment:

Note, testHasSubpages fails for me (Since I have subpages enabled in main 
namespace on my test wiki). I don't know if unittests are supposed to care if 
users have non-default stuff in LocalSettings.php, so I don't know if that's an 
issue or not.

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to