Done:
* Replace LanguageConverter::newConverter by LanguageConverterFactory::getLanguageConverter
* Remove LanguageConverter::newConverter from all subclasses
* Add LanguageConverterFactory integration tests which covers all languages by their code.
* Caching of LanguageConverters in factory
* Make all tests running (hope that's would be enough)
* Uncomment the deprecated functions.
* Rename FakeConverter to TrivialLanguageConverter
* Create ILanguageConverter to have shared ancestor
* Make the LanguageConverter class abstract.
* Create table with mapping between lang code and converter instead of using name convention
* ILanguageConverter @internal
* Clean up code
Change-Id: I0e4d77de0f44e18c19956a1ffd69d30e63cf51bf
Bug: T226833, T243332
The following were the most common cleanups required by switching to tidy:
* Inserting <tbody> in <table> output
* Inserting a space before the closing `/>` in <br>/<link>/<img>/<input> tags
* Entity encoding > and in the output
* Adding `class="mw-empty-elt"` to empty elements in the output, and
preserving some empty elements which the untidy mode's hacky "regex tidy"
would have removed
* Fix `title` attributes in section edit links (seems to have been a bug
in the non-tidy path, but no one noticed because that's not run in
production)
All tests now have a `php+tidy` clause. I've left some `php+untidy`
clauses in place to aid review; it makes it easier to see what tidy
did to the output. Eventually all the untidy clauses will be removed.
Bug: T174199
Bug: T198214
Change-Id: I40363339c615d915a5519650315c1a2682fb9786
This patch tries to make assertions in tests more readable by using more
self-documenting assertions as provided by modern PHPUnit versions. Among
a few others, these two main changes are done:
* I found a lot of assertions with the expected value being the *second*
parameter. I did not changed all of them. Only some that can be replaced
with assertNull() and such.
* I try to replace all `assertTrue( is_…() )` with dedicated assertions.
Change-Id: I1fc72188fbd0edacf13886e7f9a9eacbd85f13c2
Remove the deprecated Preprocessor_DOM class, which was hard-deprecated
in 1.34. This begins to simplify parser configuration and reduce redundant
code paths, but I've left two things for cleanup in a future patch:
1. The `preprocessorClass` configuration option to the parser, exposed
in `$wgParserConf`, ServiceWiring, ParserFactory, etc. There is no reason
for this to be exposed as configurable, but I've left this clean up to a
future patch.
2. The `$wgMaxGeneratedPPNodeCount` configuration, exposed also in
ParserOptions. Only Preprocessor_DOM calculated this count, and since
we are only using Preprocessor_Hash now, this configuration has no effect.
But since this value was exposed in ParserOptions and elsewhere, I've
deprecated where needed but left this clean up to a future patch.
Bug: T204945
Change-Id: I727f003f9a42d0c92bcbcce8a8289d5af6cd1298
I found this while looking for something completely different. The
actual problem here is: Before, the test would accept *any* falsy value
(null, false, even the string "0"). But what needs to be checked here is
that the list of errors is empty. This is what the `=== []` comparison
now does.
Change-Id: I16d3534ba324b0cd35a86682ffbb8cff9eedc015
Options intended for MediaWiki must be removed from the argument list
including any arguments that follow them.
Bug: T243523
Change-Id: I8c29ca8c11a16bd43f534310a34bd1cc1f595287
This is step 1 of deprecating and then removing tests without a "tidy"
section. We're first adding support for marking test clauses explicitly
as 'untidy'. Then in a subsequent patch we're going to change the
default for otherwise-unmarked tests from 'untidy' to 'tidy'.
Bug: T174199
Bug: T198214
Change-Id: I1e2cbbd46282cb618178662ceaf8b1c36490d546
We don't currently use this flag, and if we were to start doing so, this
would make development impossible on Windows machines as php-invoker is
POSIX-only.
Bug: T243324
Change-Id: I114518ec626020945b948e355eff7fd204fa4ef3
Add an endpoint to the core REST API to return the list of
media files embedded in a page, including certain metadata
for each media file.
Bug: T236169
Change-Id: I3188848ee7de365d209dfb7da5b885313e9f705b
This resolves the issue that one cannot use a replacement placeholder
(e.g. `$4`) multiple times in a message if one intends to provide an
jQuery or HTMLElement as argument.
Change-Id: I6246264621c05fdb894d64e86d3ca248c11156a5