Commit graph

186 commits

Author SHA1 Message Date
Subramanya Sastry
5923105af1 Added nested-list tests for covering additional cases for Parsoid.
Change-Id: Ic0ea44a5d965bfd27b34a790f18ef29f2ac20d6a
2012-06-06 17:16:01 -05:00
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
Gabriel Wicke
f5790ba627 Improve / add two passing link tests
* Add a transition *** -> #** to an existing test
* Add a test for interrupted lists

Change-Id: I09b81099a7e8a8b08fefb194670f91648c3e077f
2012-06-04 13:36:18 +02:00
Gabriel Wicke
da0dd987ed Add passing test for padleft and padright as substr
This is a popular 'misuse' of the padleft/padright functions, which was not
tested in the main parser tests so far.

Change-Id: Icda02b34101c8c35b13c1e84d9f565867148d8d8
2012-06-04 11:29:59 +02:00
Gabriel Wicke
1a7f80b18b Add passing test for definition list with empty definition
Change-Id: I850f2389274aca76bab0b4a340a14af58e349b93
2012-05-25 15:38:28 +02:00
robin
84b8ca9801 Remove extra unneeded whitespace
This whitespaces causes an extra empty paragraph between text and transcluding a special page.
When a heading precedes a transcluded special page, there is no difference and it's fine with or without this whitespace.

See for example http://incubator.wikimedia.org/w/index.php?title=Incubator:Sandbox&oldid=822299

Change-Id: I6b06006d921368619d3969660c244176344e8aff
2012-05-12 23:37:50 +02:00
robin
96753a2327 Very basic parser test for language function
Change-Id: I7fad6caa460a4f62881c33ae9f7bd30e6a5942d1
2012-05-03 22:23:09 +02:00
Brion VIBBER
c9ebb1698c Merge "(bug 34852) new optional 'link' parameter to <gallery>" 2012-04-16 17:33:07 +00:00
Kim Eik
0a52782667 (bug 34852) new optional 'link' parameter to <gallery>
The patch adds an optional parameter |link= to the <gallery>
tag. This will allow for images to link to other pages and
externals urls instead of being hardlinked to the image file
that is displayed in the gallery.

Here are a couple of examples.

Link as WikiLink:
<gallery>
File:20120106_001.jpg|link=Main_Page
</gallery>

Link as absolute URI:
<gallery>
File:20120106_001.jpg|my caption|alt=my alt
text|link=http://bugzilla.wikimedia.org
</gallery>

this would cause the link on the thumbnails rendered by the gallery tag to link
to a custom page/url instead of the actual media/image.

a link should be an internal wiki link or an absolute uri as shown in the examples.

Change-Id: I21b276ad5c7a8df13b3a716957d23fd53c37d29e
2012-04-16 10:09:31 +02:00
Adam Wight
376d54f4c5 document how the parser handles list items coming from a template,
especially the surprising start-of-line behavior.  This test will
be used to implement matching behavior in Parsoid.

Change-Id: Ibfa13dfd2be2d62c285449cb090e2b112fe30f9b
2012-04-12 08:50:29 -07:00
umherirrender
bf2a9989b2 (bug 23006) create #speciale parser function
Also add explicit Title::getPrefixedText() in
CoreParserFunctions::special, so that method does not rely on
Title::toString.

Change-Id: I1d041b11386bff15811e19de47a662e5ed7a2b07
2012-04-06 09:14:47 +02:00
Gabriel Wicke
792792b68a Add passing test documenting MW's acceptance of pipes between tr attributes
Change-Id: I584a8826348a9acc4facfaadf5766832d262a53d
2012-04-05 15:52:05 +02:00
Amir E. Aharoni
fe0b0270fd (bug 31817) add support for HTML5 <bdi> bidi embed element
Adding <bdi> to $htmlpairsStatic to allow using this tag.

Adds parser test case to confirm that <bdi> makes it through with 'lang' attribute.

This updated patchset also adds <bdi> to the attribute whitelist with the basic common attribute; allows 'lang' and such to get through.

Change-Id: Ib7e6553f017837cb1d49d5718e288228c17392c0
2012-04-04 13:11:55 -07:00
umherirrender
b5511c68c3 (bug 34355) add a variable and parser function for the namespace number
Change-Id: Ie162cfda7ddd38d4278ceee5fd23f5a4e579cb96
2012-04-03 13:25:06 -07:00
Tim Starling
13b514edae Fixed a few "strip tag exposed" bugs.
* Introduced Parser::killMarkers() based on the concept from StringFunctions. Used it in cases where markerStripCallback() doesn't make sense semantically, namely grammar, padleft, padright and anchorencode. Used markerStripCallback() in other cases.
* Changed headline unstrip order as suggested by P.Copp on bug 18295
* In CPF::lc() and CPF::uc(), removed the is_callable(). This was a temporary testing hack committed by me in r30109, which allowed me to do differential testing against a copy of the parser from before that revision.
2012-03-20 04:39:09 +00:00
Tim Starling
a654a6e79a Fixed attempt to write to the wiki's upload directory during parser tests instead of /tmp, this is not allowed. I'm not sure what setupGlobals() is meant to do nowadays, that part is untested. It seems to be duplicated in ParserTest::__construct(). 2012-03-20 00:28:30 +00:00
Amir E. Aharoni
4b439bb6ad Bug 35034 - moved autocomment-prefix between the prefix and the arrow. Follow up to r109086. 2012-03-13 23:09:06 +00:00
Daniel Friesen
73482615dd Revert Microdata improvements in r111891, r111898, r111899, r111901, r111903, and r111906 till after the git migration. 2012-02-20 22:32:18 +00:00
Daniel Friesen
ce58ef75f4 Followup r111891; Update the test to also make sure things like http-equiv and rel=stylesheet don't link through. And update the sanitizer code so that bad <link> and <meta> tags show in proper plaintext when tidy is enabled just like they do when not. 2012-02-20 00:42:24 +00:00
Daniel Friesen
42a1d6bf03 Handle one part of bug 32545 while improving MediaWiki's support for Microdata in content by adding support for the <data>, <time>, <meta>, and <link> elements. The latter two are only permitted when Microdata is enabled, and for security are only allowed to be actual elements when they have a strict set of attributes set. 2012-02-19 21:43:37 +00:00
Sam Reed
6454687806 Improve documentation
Simplify if

Fix whitespace
2012-02-02 20:19:20 +00:00
Platonides
49e6e233ec Bug 33845: Headings become cursive in TOC when they contain an image
Fixes the problems with r102179 and r102179, as there are
valid tags which begin the same, which meant they were not removed from
the TOC (the second regex, intended to remove tag parameters, then converted
<img or <blockquote> into <i> / <b>).
The same problem existed in the original regex, but as there are no valid 
tags which begin with sup or sub, it never happened).

Added comment explaining the tocline regex, and added a bunch of parser tests.
2012-01-21 16:27:27 +00:00
Amir E. Aharoni
9691721f65 Follow up to r105855 - now with updated phpunit tests. 2012-01-17 00:17:55 +00:00
Platonides
4fc7769069 Revert r108358. It's a good fellow and we like to keep it. 2012-01-09 22:33:00 +00:00
Antoine Musso
bd7038e3c1 tip to run parser tests
Follow r108358
2012-01-09 12:47:21 +00:00
Chad Horohoe
95d52efc32 * Drop old parserTests.php way of running parser tests. You can run parser tests via --group Parser or specifying
the includes/parser/MediaWikiParserTest.php test case
* Drop now unused various test recorder options -- phpunit outputs its data in lots of machine-readable formats, use those if you need to work with
  test data
* There's still a lot of duplication between NewParserTest::setUp() and MediaWikiTestCase, but hey one step at a time ;-)
* All tests pass for me (make phpunit && make parser)
2012-01-08 17:28:13 +00:00
Alexandre Emsenhuber
40c98e0ad1 * Don't select (even twice for PHPUnit tests) "FOR UPDATE", but use the master database directly instead
* Also pass the line number
* Removed useless usage of $title when throwing the exception about invalid since that variable is always null
* Added $ignoreDuplicate parameter to ParserTest::addArticle()
2012-01-07 12:19:10 +00:00
Aaron Schulz
6a1bb85f80 r108300: updated parserTest.inc tests and re-enabled testBug29408() 2012-01-07 09:26:11 +00:00
Antoine Musso
09cb2e1ca2 parserTest need to clone user_former_groups table
Not sure why it is suddenly needed.
2012-01-05 11:03:53 +00:00
Alexandre Emsenhuber
ccdf2679b2 Fix for r106752: manually add the backend to the fake local repo to avoid exception when running parser tests.
See https://www.mediawiki.org/wiki/Special:Code/MediaWiki/106752#c28264 for the report.
2011-12-31 14:43:14 +00:00
Aaron Schulz
eeb4bd77e1 * FU r106752: de-uglified Setup.php by moving most of the b/c code into FileBackendGroup. Deferred registration of file backends and lock managers to the respective singleton() functions for the group objects.
* Refactored FileRepo::initZones() to require the specific zones; nothing was using it differently.
* Removed deleted zone check in deleteBatch(), a similar error will instead trigger with the initZones() call as needed.
* Added $wgLocalFileRepo comment.
* Updated tests.
2011-12-22 01:06:19 +00:00
Aaron Schulz
53f96171cc FU r106752: use "media-" instead of "images-" in container names. Long live books, video, 3D meshes, and animated holograms from the future! 2011-12-20 23:47:53 +00:00
Aaron Schulz
ff404538c2 Set deleted zone container in parserTest.inc 2011-12-20 08:47:48 +00:00
Aaron Schulz
5275f9b097 Merged FileBackend branch. Manually avoiding merging the many prop-only changes SVN likes to sprinkle in (easy to spot from the change list). Did not add SwiftFileBackend.php as it still is in development. 2011-12-20 03:52:06 +00:00
Alexandre Emsenhuber
658f17dbee Use WikiPage instead of Article 2011-12-11 09:44:02 +00:00
Tim Starling
71e27e22de * Revert r103476, r105161 and implement the fix for bug 32858 (a.k.a. bug 32450) in WikiPage instead. See comment 14 for further rationale.
* Clarified release notes. Please write what the new code does, not the bug description.
2011-12-09 10:32:55 +00:00
Platonides
50c4ee897d Follow up r104314 as noted in bug 21261 comment 9 2011-12-06 21:27:55 +00:00
Gabriel Wicke
959aa336a1 Add comment on legality of plain % in html5 spec for later consideration. 2011-12-06 16:04:43 +00:00
Gabriel Wicke
6897b146a4 Fix misleading parser test title, likely a copyo from the one just before it.
This test is about %25 in an URL, not %26.
2011-12-06 15:43:40 +00:00
Antoine Musso
144ffcc01a allow bold in TOC lines
just like r102179 allowed italics in TOC lines for bug 26375, this
patch allow bold text as well.
2011-12-06 10:50:47 +00:00
Antoine Musso
413411c837 restore parser tests names
r100932 disabled two 'Bad images' tests but did so by also erasing the
test name. Hence we could no more tests them even with --run-disabled.


Test plan:
==========

$ php parserTests.php --run-disabled --filter 'Bad images'
--> output two tests failing as expected

$ php parserTests.php --filter 'Bad images'
--> output no tests found

$ php parserTests.php --quiet
--> ALL PASSED :-)
2011-11-29 10:22:09 +00:00
Antoine Musso
4a5d2701eb use meaningful test in a parser test
Readin the text case, I though 'pre' was some kind of magic keyword to render
a preformatted text. It happens it is just a text. Replacing it with something
that will not confuse me or others.

follow up r103933
2011-11-28 15:19:09 +00:00
Platonides
025d7105ba Added parser test about brackets and for bug 21261 2011-11-26 21:47:37 +00:00
Brion Vibber
d60063eac2 Revert r103795 -- adds <dws> pseudotag which modifies preprocessor behavior in some way to eat whitespace
Not sure whether this is something we want, but it should probably be talked over first.
2011-11-23 00:30:13 +00:00
Gabriel Wicke
956c2ab03b Adding passing test case for nested lists using a mix of wiki and html syntax. 2011-11-22 18:46:31 +00:00
Gabriel Wicke
af00fb386b Add test case described by Vitaliy Filippov in bug 6200. 2011-11-22 18:14:23 +00:00
John Du Hart
216d661d3b Bug 29524 - Rename RequestContext::getLang to getLanguage
I'll be amazed if this doens't break any tests.
2011-11-21 16:13:21 +00:00
Mark A. Hershberger
5bd4f88169 Fixes Bug 31865 - Tag <dws> for discarding whitespaces.
Patch with parser tests from Van de Bugger
2011-11-21 01:45:23 +00:00
Antoine Musso
9a76749cc3 parserTests: add --filter as an alias of --regex
PHPUnit use the --filter option and I keep incorrectly using it for
parserTest. So this is adding an alias of --regex.
2011-11-19 18:24:43 +00:00