Commit graph

23 commits

Author SHA1 Message Date
Alexandre Emsenhuber
3732676a8c Removed assertions calling MWNamespace::isMain() from MWNamespaceTest::testIsSubject() that give an error since the former now calls wfDeprecated() 2012-02-15 13:31:20 +00:00
Krinkle
be12ebf1ab [Core JS] More fixing of global config variable usage
* mw.config is the new way, and global config variable lookups are deprecated

* Based on two phase3-wide quick searches:
-- of " wg": http://toolserver.org/~krinkle/wikimedia-svn-search/view.php?id=321&hash=81700bf7486e4fee3b7bc1f83eb9eba6
-- of "!wg": http://toolserver.org/~krinkle/wikimedia-svn-search/view.php?id=327&hash=47c9d54a7a1d5d58a724dd834585f40d

Related changes:
* Changed some php comments mentioning "wg" variables to include the dollar sign, and a typo when the wf function prefix was meant.
* Removed TODO comment in wikibits.js and made it use the JS equivalent of wfUrlencode, which we have now, mw.util.wikiUrlencode 
* SpecialUpload.php: use OutputPage::addJsConfigVars instead of creating a new script tag through OutputPage::addScript(Skin::makeVariablesScript(..))
* Renamed wgUploadSetup in upload.js and made it local. Not used anywhere in ./trunk/phase3 and ./trunk/extensions
* Fix OutputPage::addJsConfigVars so that it can actually be called with an array instead of two arguments for key/value
* Some minor whitespace/convention stuff around the same line
2011-12-31 21:25:00 +00:00
Antoine Musso
0ec2d313f0 fix typo in message
follow r105891
2011-12-12 15:47:31 +00:00
Antoine Musso
08b90ed58b use an helper to test NS subjects 2011-12-12 15:39:01 +00:00
Antoine Musso
fd23fb72d8 add some namespaces equality tests
Follow up 103893
2011-12-12 15:31:48 +00:00
Antoine Musso
78e9bbd529 use MWNamespaceTest helpers based on __call()
* Added some new methos such as Watchable/Subpages/Capitalized/Content
* Fixed namespace 0 being converted to NS_ , now show NS_MAIN
* Converted all assertion calls to use the __call() hack

Follow up r105883
2011-12-12 15:26:12 +00:00
Antoine Musso
90a5c227dc use __call() to instantly have some new fresh helpers
Only for MWNamespaceTest :-)
2011-12-12 15:02:47 +00:00
Aaron Schulz
3e26c05e80 * Fixed failing FlaggedRevs tests (one due global to leaks from a core test) and made it clean up the DB table afterwards 2011-12-10 20:08:58 +00:00
Daniel Friesen
3414e91bae 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.
2011-11-22 13:34:55 +00:00
Antoine Musso
c1f23144e1 using real identity for hashar
Converting my pseudonym to use my real identity instead:
Ashar Voultoiz -> Antoine Musso
2011-10-24 09:08:13 +00:00
Sam Reed
429c16803d Fix missing $ from r95439 2011-08-24 20:15:04 +00:00
Sam Reed
30dff02424 Fixup the rest of r82577 2011-08-24 20:14:03 +00:00
Sam Reed
98d2168ffb Fix testGetTalkExceptions from r82577 2011-08-24 19:52:24 +00:00
Sam Reed
365f043fd5 Followup r82577
Remove $this->object

Swap assertEquals parameters
2011-08-24 19:32:40 +00:00
Antoine Musso
08334c06c8 Fix up NS_MAIN subpage tests
Per CR on r92234, this correctly test hasSubpages independently from your
local configuration.  Also test altering the global and having static
methods reacting accordingly.
2011-08-15 14:17:45 +00:00
Platonides
e9c95dbb4a Commit a list of unimplemented tests. 2011-07-20 15:38:13 +00:00
Antoine Musso
76496b0e02 NS_MAIN can locally have subpages enabled
This workaround test if any local change has been made, if so the test
will be skipped.

fu r82577
2011-07-15 09:45:57 +00:00
Chad Horohoe
26ec01f63c Extend MediaWikiTestCase in a few places 2011-05-25 00:30:06 +00:00
Siebrand Mazeland
75c6696aa8 Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org/doc/todo.html nicely. 2011-05-17 22:03:20 +00:00
Antoine Musso
3ec5811451 Fix MWNamespaceTest::testGetTalkExceptions()
It was actually testing for associated. Thanks copy & paste for this bug.

Test result:

$ php phpunit.php -c suite.xml includes/MWNamespaceTest.php
.........IIIII..........
Tests: 24, Assertions: 99, Incomplete: 5.
2011-05-14 12:01:08 +00:00
Platonides
49ed86e93f Remove trailing ?> 2011-02-22 15:09:41 +00:00
Antoine Musso
e9149c09f0 remove hardcoded local path 2011-02-21 22:56:16 +00:00
Antoine Musso
f909c62d64 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.
2011-02-21 22:17:06 +00:00