mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 08:23:52 +00:00
361283a332
We originally used 'templates' because it seemed like an obvious choice for HTML files, and because 'packageFiles' requires extra code to include anything that isn't a .js or .json file. However, the templates are expected to be HTML fragments rather than whole documents, and they are parsed in a particular way that takes a lot of code to clean up (which we needed to do, because we use the same test files for testing PHP code). I tried doing it in the 'packageFiles' way, and the extra code doesn't seem that bad in comparison after all. Moreover, the 'templates' mechanism (when used the intended way) feels vaguely deprecated in favor of Vue.js, and I'd rather move away from it. This makes the tests faster too (probably mostly thanks to the removal of the clean up code) – on my machine they go from 1800ms to 1500ms. (Simplify linearWalk tests, as we no longer need to do weird things with document fragments to get consistent outputs in PHP and JS.) Change-Id: I39f9b994ce5636d70fea2e935a7c87c7d56dcb26 |
||
---|---|---|
.. | ||
ar-nbsp-timezone-oldparser | ||
ar-nbsp-timezone-parsoid | ||
ar-no-paragraph-oldparser | ||
ar-no-paragraph-parsoid | ||
ckb-big-oldparser | ||
ckb-big-parsoid | ||
double-signature1 | ||
double-signature2 | ||
dt-tags-oldparser | ||
dt-tags-parsoid | ||
empty-comments | ||
en-big-oldparser | ||
en-big-parsoid | ||
en-bigafd-parsoid | ||
EventDispatcher | ||
fake-headings | ||
fallback-encoding-link | ||
for-parser-cache | ||
fr-unsigned-oldparser | ||
fr-unsigned-parsoid | ||
it-unsigned-oldparser | ||
it-unsigned-parsoid | ||
linearWalk | ||
lrm-signature | ||
mixed-indentation | ||
parsoid-sections | ||
pl-big-oldparser | ||
pl-big-parsoid | ||
reflist-oldparser | ||
reflist-parsoid | ||
selflink-signature | ||
signatures-comments | ||
signatures-funny | ||
single-comment-heading | ||
single-comment-no-heading | ||
span-about-group | ||
split-list | ||
split-list2 | ||
sr-ec | ||
sr-el | ||
ThreadItemStore | ||
timestamp-format-switch | ||
tracked-template | ||
transclusions | ||
transclusions2 | ||
transclusions3 | ||
transclusions4 | ||
unclosed-font | ||
wrappers | ||
wrappers2-oldparser | ||
wrappers2-parsoid | ||
appendSignature.json | ||
authors.json | ||
comments.json | ||
datatest-ckb.json | ||
datatest-en.json | ||
datatest-sr.json | ||
datatest-th.json | ||
formatted.json | ||
getHTML.json | ||
getText.json | ||
isSingleCommentSignedBy.json | ||
linearWalk.json | ||
modified.json | ||
README.txt | ||
reply.json | ||
sanitize-wikitext-linebreaks.json | ||
threaditemshtml.json | ||
timestamp-parser-dst.json | ||
timestamp-parser.json | ||
timestamp-regex.json | ||
transcluded.json | ||
unwrap.json |
To update the expected outputs, run the PHP tests with the environment variable "DISCUSSIONTOOLS_OVERWRITE_TESTS" set to any value, e.g.: DISCUSSIONTOOLS_OVERWRITE_TESTS=1 php tests/phpunit/phpunit.php extensions/DiscussionTools/tests/phpunit/ The input HTML files were saved from: pl-big: https://pl.wikipedia.org/w/index.php?action=render&title=Wikipedia:Kawiarenka/Artyku%C5%82y_dyskusja/Archiwum/2018-pa%C5%BAdziernik&oldid=55171451 https://pl.wikipedia.org/api/rest_v1/page/html/Wikipedia%3AKawiarenka%2FArtyku%C5%82y_dyskusja%2FArchiwum%2F2018-pa%C5%BAdziernik/55171451 en-big: https://en.wikipedia.org/w/index.php?action=render&title=Wikipedia:Village_pump_(technical)/Archive_175&oldid=913983958 https://en.wikipedia.org/api/rest_v1/page/html/Wikipedia%3AVillage_pump_(technical)%2FArchive_175/913983958 ckb-big: https://ckb.wikipedia.org/w/index.php?title=ویکیپیدیا:دیوەخان_(پێشنیارەکان)&oldid=638545&action=render https://ckb.wikipedia.org/api/rest_v1/page/html/ویکیپیدیا%3Aدیوەخان_(پێشنیارەکان)/638545 en-bigafd: https://en.wikipedia.org/api/rest_v1/page/html/Wikipedia%3AArticles_for_deletion%2FLog%2F2020_March_7 ar-no-paragraph: https://ar.wikipedia.org/w/index.php?action=render&title=نقاش_المستخدم:Khaled&oldid=45576943 https://ar.wikipedia.org/api/rest_v1/page/html/نقاش_المستخدم%3AKhaled/45576943 ar-nbsp-timezone: https://ar.wikipedia.org/wiki/ويكيبيديا:إخفاء_أرقام_الآي_بي?oldid=46583196&action=render https://ar.wikipedia.org/api/rest_v1/page/html/ويكيبيديا%3Aإخفاء_أرقام_الآي_بي/46583196 fr-unsigned: https://fr.wikipedia.org/w/index.php?title=Discussion:Le_Monde&oldid=170426593&action=render https://fr.wikipedia.org/api/rest_v1/page/html/Discussion%3ALe_Monde/170426593 it-unsigned: https://it.wikipedia.org/w/index.php?title=Aiuto:Sportello_informazioni&oldid=116856029&action=render https://it.wikipedia.org/api/rest_v1/page/html/Aiuto%3ASportello_informazioni/116856029 sr-ec: https://sr.wikipedia.org/w/index.php?title=Википедија:Трг/Архива/Техника/35&variant=sr-ec&action=render sr-el: https://sr.wikipedia.org/w/index.php?title=Википедија:Трг/Архива/Техника/35&variant=sr-el&action=render unclosed-font: https://nl.wikipedia.org/w/index.php?title=Overleg_gebruiker:RYasmeen_(WMF)&oldid=57970619&action=render double-signature1: https://en.wikipedia.org/w/index.php?title=Wikipedia:Requests_for_comment/User_names&oldid=1002108637&action=render double-signature2: https://en.wikipedia.org/w/index.php?title=Wikipedia:Articles_for_deletion/Equal_Education&oldid=1009060583&action=render transclusions2: https://en.wikipedia.beta.wmflabs.org/api/rest_v1/page/html/Talk%3AT289873/514467 transclusions3: https://en.wikipedia.org/api/rest_v1/page/html/Wikipedia_talk%3ATemplate_documentation/1056728376 wrappers2: https://en.wikipedia.org/w/index.php?title=User_talk:Dylsss&oldid=1058459889&action=render https://en.wikipedia.org/api/rest_v1/page/html/User_talk%3ADylsss/1058459889 transclusions4: https://it.wikipedia.org/api/rest_v1/page/html/Wikipedia%3AVandalismi_in_corso/124462482 tracked-template: https://commons.wikimedia.org/api/rest_v1/page/html/Commons_talk%3ASPARQL_query_service fake-headings: https://pl.wikipedia.org/w/index.php?title=Wikipedia:Propozycje_do_Artyku%C5%82%C3%B3w_na_Medal/Aposto%C5%82_Pawie%C5%82&action=render Text is available under the Creative Commons Attribution-ShareAlike License. See these pages for attribution.