Commit graph

338 commits

Author SHA1 Message Date
Platonides
fd84fbf739 Fix problem when running a fakePipeFound, which could lead to literals being incorrectly added to the part node instead of the value node. 2011-02-05 20:05:00 +00:00
Antoine Musso
596956c928 Test suite for revisions and date related magic variables.
Tests should be carefully reviewed, please note there is are exceptions
for 'revisionday' and 'revisionmonth1' magics which are hardcoded in
the parser to return an integer.

Follow up r66200

TESTS:

$ php phpunit.php -c suite.xml --filter MagicVariable --testdox
PHPUnit 3.5.10 by Sebastian Bergmann.

MagicVariable
 [x] Currentday is un padded
 [x] Currentdaytwo is zero padded
 [x] Localday is un padded
 [x] Localdaytwo is zero padded
 [x] Currentmonth is zero padded
 [x] Currentmonthone is un padded
 [x] Localmonth is zero padded
 [x] Localmonthone is un padded
 [x] Revisionday is un padded
 [x] Revisiondaytwo is zero padded
 [x] Revisionmonth is zero padded
 [x] Revisionmonthone is un padded
$
2011-02-02 21:04:21 +00:00
Alexandre Emsenhuber
51c6afc751 * Replaced $wgMessageCache by MessageCache::singleton(); since we only use one instance of this class (as for ParserCache, LinkCache)
* MessageCache::singleton() calls wfGetMessageCacheStorage() directly instead of using $messageMemc, just in case this would be called before that variable is set
* Per TimStarling: also removed deprecated methods in MessageCache class: addMessages() and related, [get|set|enable|disable]Transform(), loadAllMessages(), loadMessageFile() and some others. Same for the legacyData stuff in LocalisationCache that was only used by MessageCache::addMessages() and related. 
* Converted remaining extensions
2011-01-26 15:42:04 +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
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
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
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
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
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
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!
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
X!
c667c3f1be Reorder functions around, add some form of order to the test suite.
It'd be nice to break some of these functions out to another class, but then again, 
I'd also like to see Windows actually become stable, MediaWiki to become fully class based, 
and Google to stop taking over the world. We can't all have what we want.
2011-01-01 20:57:13 +00:00
X!
2b8f832da8 Add fuzz tests to new parser tests (someone else should make sure this works as expected) 2011-01-01 18:10:28 +00:00
X!
37279160f3 Don't use the --verbose option anymore 2011-01-01 17:05:08 +00:00
X!
332e01addf Add parsertest specific help to PHPUnit.php 2011-01-01 06:49:00 +00:00
X!
f8d74604fd More work on new parser tests:
-No need to specify a new function for each argument, use PHP5 magic to automatically set it
-Create (g|s)etCliArg() functions
-Implement some features from the old parser tests
2011-01-01 05:53:04 +00:00
X!
34fc833407 Start work on porting ParserTests completely into PHPunit.
Disable temporary tables, a few reports of them not working. The tables get deleted anyway, so why risk it?
2011-01-01 03:39:37 +00:00
Platonides
c3dfabcf6d This global declaration is now unused. 2010-12-30 16:19:10 +00:00
X!
194ab8bb57 Self-reverting my reversion of r79154 in r79158. The old version is flawed and broken beyond belief. At least this version works. 2010-12-29 16:40:31 +00:00
Platonides
3aa8a1d61a Replace the global $additionalMWCLIArgs with a class variable.
Provide a default value for verbose since it is checked regardless of existance.
2010-12-29 16:24:59 +00:00
X!
05c6b53899 Partial revert of r79154. hexmode asserts that these work, even though I keep getting OK (0 tests, 0 assertions) 2010-12-29 03:35:17 +00:00
X!
edbf743aeb Make MediaWikiParserTest work now in PHPUnit. There are still a few bugs, such as stopping tests if one fails,
lack of fuzz testing and other parser test options, and the DB creation is still a little flaky.
A MediaWikiPHPUnitCommand class had to be created to allow for custom CLI parameters.
2010-12-29 02:23:51 +00:00
Chad Horohoe
447529064b * verbose and color default output from phpunit
* Make a bunch of tests subclass MediaWikiTestCase
* Parser tests and ResourceLoaderTest can't subclass it yet due to various issues
2010-12-28 18:17:16 +00:00
Chad Horohoe
5f528203aa Rename MediaWikiTestSetup to MediaWikiTestCase: this is going to be the base class for all unit tests from now on 2010-12-28 17:45:33 +00:00
Chad Horohoe
65652a6f33 Fix path changes from move in r78383 2010-12-14 16:33:06 +00:00
Chad Horohoe
23f69f10ed Per wikitech-l discussion: Move tests from maintenance/tests/ to tests/. They're not strictly maintenance scripts, and some people want to do a selective checkout that doesn't include the tests. There's still debate on whether we should include these in the release downloads, but we had a pretty firm consensus to move this. 2010-12-14 16:26:35 +00:00