Commit graph

89 commits

Author SHA1 Message Date
Antoine Musso
045772c641 Test uploading a file of size $wgMaxUploadSize
TODO: method testMaxUploadSize() shoud be able to use differents
settings.  The assertion could then get moved elsewhere in a nice
helper.
2011-01-25 21:26:28 +00:00
Platonides
86a4780482 Missed the case where there is an equals.
It's ugly having to add that literal node there.
2011-01-24 22:10:22 +00:00
Platonides
70856c881a Silly bug with value nodes. 2011-01-24 19:40:25 +00:00
Platonides
fb5cebcc6d preSaveTransform() needs $wgTitle. 2011-01-23 18:43:08 +00:00
Platonides
8a6475bd70 Don't look for pipes in the root node. 2011-01-22 16:34:14 +00:00
Platonides
069765d4b6 Add full articles to preprocessor tests.
* QuoteQuran.txt is GFDL/CC-BY-SA, created by [[en:User:Striver]] at http://en.wikipedia.org/w/index.php?title=Template:QuoteQuran/sandbox&oldid=237348988
* Factorial.txt is GFDL + CC-BY-SA, created by [[en:User:Polonium]] at http://en.wikipedia.org/w/index.php?title=Template:Factorial&oldid=98548758 
* All_system_messages.txt was generated by MediaWiki, so already GPL. Copied from http://tl.wiktionary.org/w/index.php?title=Suleras:All_system_messages&oldid=2765

Added along their preprocessed xml.
2011-01-21 23:03:33 +00:00
Platonides
f6763bdb88 The << operator (level 7) has greater priority than bitwise or (level 12),
which makes getNextSibling() function wrong for values >= 256.
2011-01-21 22:00:07 +00:00
Antoine Musso
4868ccbf3d Hack invalid w3 spec to validate @localhost email
In r75682, I have implemented a PHP function to validate email address
based on bug 22449.  Siebrand pointed a w3.org specification which I
implemented. The spec is bugged since it requires a domain and a top
level domain!

I could either make the first part optional or alter the second part
to require 0 to x elements.  I choose the later: s/+/*/

Should fix bug 22449 for good.

TESTS:

Added testEmailDoesNotNeedATopLevelDomain:

Made following emails valid:
  user.@localdaomin
  .@localdomain
  user@a

Test output (please add more):
$ php phpunit.php -c suite.xml --filter alidEmail --tap
TAP version 13
ok 1 - UserIsValidEmailAddrTest::testEmailWellKnownUserAtHostDotTldAreValid
ok 2 - UserIsValidEmailAddrTest::testEmailWithUpperCaseCharactersAreValid
ok 3 - UserIsValidEmailAddrTest::testEmailWithAPlusInUserName
ok 4 - UserIsValidEmailAddrTest::testEmailDoesNotNeedATopLevelDomain
ok 5 - UserIsValidEmailAddrTest::testEmailWithWhiteSpacesBeforeOrAfterAreInvalids
ok 6 - UserIsValidEmailAddrTest::testEmailWithWhiteSpacesAreInvalids
ok 7 - UserIsValidEmailAddrTest::testEmailDomainCanNotBeginWithDot
ok 8 - UserIsValidEmailAddrTest::testEmailWithFunnyCharacters
ok 9 - UserIsValidEmailAddrTest::testEmailTopLevelDomainCanBeNumerical
ok 10 - UserIsValidEmailAddrTest::testEmailWithoutAtSignIsInvalid
ok 11 - UserIsValidEmailAddrTest::testEmailWithOneCharacterDomainIsValid
1..11
2011-01-21 18:01:47 +00:00
Platonides
0745a738b1 The pipes were no recognized after a link. A one line fix in the code :) 2011-01-19 20:46:00 +00:00
Platonides
63eea0f737 Follow up r80461. In some cases the closing tags for internal tags were not recognised. 2011-01-17 23:12:07 +00:00
Platonides
8081138adb Follow up r80376. Added missing file FORMAT.
Fixed method call in Preprocessor_Native.php.
Added support for tags containing spaces (r80025), following the same odd order dependant behavior as the php preprocessors.
Extensions shouldn't rely on it. See http://thread.gmane.org/gmane.science.linguistics.wikipedia.technical/51496 
As a result of these changes, there is much less worst-case lookahead now.
in_array.{c,h} are now unused.
2011-01-17 19:54:44 +00:00
X!
7ea48c9778 Followup to r80435: Forgot the svn add 2011-01-17 16:43:12 +00:00
Platonides
a8dce135d9 Another couple of tests. Also passed by the NtPrepro :) 2011-01-16 18:20:44 +00:00
Platonides
0127c7c446 Add preprocessing tests 2011-01-15 08:35:56 +00:00
Platonides
c220da92bb Mark as needing a Database, as noted in r79532 CR.
It is needed for calling getServerVersion() to provide dbversion
2011-01-13 17:51:25 +00:00
Platonides
5ceb97cfc3 Follow up r80025.
The space is actually used inside extensions, such as Maps, covertly called as 'display_map' into 
Validator, then converted into 'display map' by getName().
2011-01-12 00:11:11 +00:00
Platonides
8f87d873fa Add tests for parser tag hooks. 2011-01-11 18:37:15 +00:00
Chad Horohoe
38babb25b5 More silly whitespace 2011-01-10 18:43:59 +00:00
Chad Horohoe
c12dcf7101 rm big whitespace 2011-01-10 18:41:31 +00:00
Antoine Musso
c59480ada3 Add a .tld to emails when testing for white space before/after.
This might avoid confusion when testing. Currently, an email without
a tld is invalid (ex user@host).  The assertions could have been
invalid just by the lack of tld, not the spaces!
2011-01-09 19:06:02 +00:00
Platonides
1235146be6 Unused global 2011-01-05 23:56:10 +00:00
Platonides
fa08f3be62 $messageMemc is used as local variable in line 63, function setUp
$messageMemc is used as local variable in line 74, function setUp
2011-01-05 23:54:07 +00:00
Platonides
7d7ea3db13 Remove the createaccount error check, failing since r79377.
The * group have createaccount right, so this seems an error.
2011-01-05 23:20:54 +00:00
Platonides
b75be64f49 Follow up r79532. Do not setup a user needlessly. 2011-01-05 19:35:58 +00:00
X!
e23d09cfee Fix r79532: Strct standards 2011-01-04 11:58:17 +00:00
X!
bab978f5d5 Add API query test 2011-01-04 03:22:40 +00:00
X!
3e36a442e7 Forcing array breaks MWFunction with <2 parameters 2011-01-04 01:51:48 +00:00
X!
e1f21873d5 Fix r79494: Don't prefix functions now that they're in their own class 2011-01-04 01:44:11 +00:00
X!
ffa443c049 Followup to r79532: Did I really need to implement a parameter? No, I did not. 2011-01-04 01:35:01 +00:00
X!
4e4fa436fa Add API format testing 2011-01-03 21:36:49 +00:00
X!
4ffe303e4f Add JSON test case 2011-01-03 21:14:51 +00:00
X!
c2f3948ecf Followup r79523: Test that calling self:: and parent:: throws exception 2011-01-03 21:14:22 +00:00
Sam Reed
da2c995df1 Remove unreachable return;
Add missing global $IP;
2011-01-03 03:40:26 +00:00
X!
9012b54101 Mark broken parser tests as broken 2011-01-03 02:49:52 +00:00
X!
1d0ac4a481 Move wfCreateObject to MWFunction::newObj. This uses the ReflectionClass to
instantiate a variable-length constructor in php 5.1.3 and up, and falls
back to the old, ugly, manual method that was in the old wfCreateObject
function. The instances in the core have been replaced.
2011-01-03 02:10:05 +00:00
X!
867c9402be -Add &watchuser option to ApiBlock
-Write tests for ApiBlock
2011-01-02 19:58:27 +00:00
X!
cbff3fe980 Followup to r79463: Move fallback functions to new Fallback class 2011-01-02 15:54:18 +00:00
X!
3589532db4 Per my comment on r68760: Make MWfunction class, complete with call_user_func helper functions that automatically
make the callback PHP 5.1 compatible with the Class::Method syntax. Add Unit tests to supplement it.
2011-01-02 06:48:07 +00:00
X!
4cce1efbe7 Followup to r79477: Add invalid purge title 2011-01-02 06:15:32 +00:00
X!
cbca0769b7 Add API purge test (mainly as proof of concept for how API tests should be written) 2011-01-02 06:09:58 +00:00
X!
ad6875383b Refactor much of the API testing code.
Old: ApiWatchTest not only tested the watch module, but also tested the login module,
     and the login module test was also used to log in to the API for the other tests.
New: ApiWatchTest only contains watch-specific methods. The login testing has been moved
     to ApiTest. The code used to log in and get tokens have been moved to ApiSetup. Nice,
     organized, and much nicer than before. ApiUploadTest is still pretty fugly, though.
2011-01-02 05:52:00 +00:00
X!
7d686e0164 GlobalFunction additions:
-in_string has a case-insensitive option
-wfClientAcceptsGzip has a force option to force resetting the static value, useful for unit tests

Unit tests for more global functions added
2011-01-02 04:38:04 +00:00
X!
317721e250 Add more wfDebug tests 2011-01-02 02:33:07 +00:00
X!
496ff9d410 Followup r79467: Add more wfDebug() tests, complete with MockOutputPage 2011-01-02 02:16:32 +00:00
X!
9d29978252 Add some wfDebug() unit tests 2011-01-02 01:59:52 +00:00
X!
e2c7b2ce23 Add fallback mb_* function tests 2011-01-02 01:51:44 +00:00
X!
1b4c6a0254 Fix r79447: Remove debugging code 2011-01-01 22:19:22 +00:00
Platonides
1cb56fc8e3 Remove unused globals 2011-01-01 22:16:58 +00:00
X!
27618d012b Followup r79443: Add some form of organization to the test autoloader 2011-01-01 22:16:54 +00:00
Platonides
f78ae2a51a Use an autoloader for the tests, following the ideas from r72858.
The SeleniumTestConstants class was added in r79437
2011-01-01 22:04:14 +00:00