Commit graph

10868 commits

Author SHA1 Message Date
jenkins-bot
7c6ec9a895 Merge "RevisionStore: fail on mismatching hash or size." 2020-02-03 20:25:36 +00:00
jenkins-bot
e799b64254 Merge "Fix TextPassDumperDatabaseTest to work with 0.11 schema" 2020-02-03 19:50:18 +00:00
jenkins-bot
c63dd159ca Merge "Add more tests for the user class (factory and preferences mostly)" 2020-02-03 17:17:12 +00:00
jenkins-bot
3cd45de6ed Merge "languages: Add @group Language to all tests related to Language for easier navigation through tests" 2020-02-03 16:41:25 +00:00
Peter Ovchyn
863a1d5bdd languages: Move Converter and tests to respective files
Bug: T226833, T243760
Change-Id: I6fc7f267098d663fbefd0e78457726c343c9b3e4
2020-02-03 15:31:08 +02:00
Peter Ovchyn
6ee4f72d1d languages: Add @group Language to all tests related to Language for easier navigation through tests
Bug: T226833, T243761
Change-Id: Ied7d4a1db661f5cfaefe6c392348ff56b1a5616c
2020-02-03 15:29:59 +02:00
Peter Ovchyn
61e0908fa2 languages: Introduce LanguageConverterFactory
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
2020-02-03 11:38:03 +02:00
DannyS712
0e301253f1 Add more tests for the user class (factory and preferences mostly)
Add tests for
* ::newFromId, ::newFromConfirmationCode
* ::getStubThreshold, ::requiresHTTPS
* ::setItemLoaded, ::isItemLoaded
* ::getGroupMemberships

Expand tests for
* ::getCanonicalName

Bug: T233385
Change-Id: I2c47590e1cef35387aa376303ebfa09e54c0cc34
2020-02-02 07:55:06 +00:00
jenkins-bot
51280df815 Merge "objectcache: fix cache pollution in WANObectCache Multi* methods" 2020-01-30 18:17:03 +00:00
Roan Kattouw
f8861b7622 TemplateParserTest: Add test case with syntax error
Change-Id: Id4860269e55345176ad58fd75dcf3522a8617fa2
2020-01-29 23:15:53 +00:00
Aaron Schulz
527fd0109f objectcache: fix cache pollution in WANObectCache Multi* methods
This was triggered by bad reference handling during preemptive refreshes

Bug: T235188
Change-Id: I239a3e1922f478c74c94d8d2debff28f525c7c31
2020-01-29 21:08:39 +00:00
jenkins-bot
7a68081e1b Merge "Parser: remove leftover "transparent hook" code" 2020-01-29 11:32:15 +00:00
jenkins-bot
0a46bef2db Merge "objectcache: fix storage of null values in WANObjectCache" 2020-01-29 04:14:20 +00:00
C. Scott Ananian
f5bf2f23b7 Parser: remove leftover "transparent hook" code
Followup-To: I8384f47bbcde7604efa41b83db0dbc4f429219a8
Change-Id: I6da8cefad8bc70631277f9b7bd5d1af5474259ab
2020-01-28 20:10:20 -05:00
jenkins-bot
6d7c165a22 Merge "Hard deprecate Parser::setFunctionTagHook()" 2020-01-29 00:40:03 +00:00
C. Scott Ananian
a8f3eb96ce Hard deprecate Parser::setFunctionTagHook()
This is not used in production code.

Code search:
https://codesearch.wmflabs.org/search/?q=setFunctionTagHook%7CmFunctionTagHooks&i=nope&files=&repos=

Change-Id: Ie03b1687d1c65be23213035d7cb4011ef763b69a
2020-01-28 16:20:40 -08:00
C. Scott Ananian
19bb8ac172 Add parserTests file line number to failing tests output
Change-Id: I57d8aa889ce7dbb3156c6635fb324516bb936257
2020-01-29 00:17:36 +00:00
C. Scott Ananian
12c70a513c Sync up with Parsoid parserTests.txt
This now aligns with Parsoid commit 9c52e78989bed9c4b87997ea9764f340010d9510

Change-Id: I14a618e45004dc46d822d7784303cfb02b691708
2020-01-28 17:35:39 -05:00
jenkins-bot
c119439afc Merge "Whitelist aria-hidden attribute in Sanitizer" 2020-01-28 22:18:12 +00:00
C. Scott Ananian
0437877656 Whitelist aria-hidden attribute in Sanitizer
Bug: T204618
Change-Id: I34b9b729eccd7658d5165b6661e5fd45a733b36c
2020-01-28 21:54:16 +00:00
C. Scott Ananian
897e073735 Update parserTests to v2 format (default html/php tests to tidy)
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 &gt; and &nbsp; 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
2020-01-28 21:33:05 +00:00
jenkins-bot
5700041d33 Merge "tests: qunit newFromFileName respect config for ':' replacement" 2020-01-28 20:16:26 +00:00
pwirth
2c9d92f37b tests: qunit newFromFileName respect config for ':' replacement
This is a follow up of: Ia6abba6587fb9ccb4a9fc0fbaff75b8c29de307f

Bug: T196480
Change-Id: I3db1138d5ffffb6b4b8e72970a040826e68943dd
2020-01-28 20:01:23 +00:00
Thiemo Kreuz
9c57ea2b7f Replace complicated assertions with assertIsString() and such
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
2020-01-28 19:17:58 +00:00
DannyS712
262501f064 Add more tests for the user class (email and username related mostly)
Add tests for
* ::setId
* ::getName, ::setName
* ::getEmail, ::setEmail, ::invalidateEmail
* ::whoIs

Expand tests for
* ::newFromName

Add coverage tag for ::getDBTouched

Bug: T233385
Change-Id: I565cbc0660d7a9fb16e02595598003228f6fb238
2020-01-27 01:40:57 +00:00
jenkins-bot
015d3d7a9b Merge "Hard-deprecate Sanitizer::escapeId()" 2020-01-26 22:22:29 +00:00
C. Scott Ananian
b79c1e22ad Hard-deprecate Sanitizer::escapeId()
Deprecated in MW 1.30; time to clean up any remaining uses.

Code search:
https://codesearch.wmflabs.org/deployed/?q=escapeId%5C%28&i=nope&files=&repos=

Depends-On: Ic03a5da2e1d6b8f5656555420dd573a1d698b9cc
Depends-On: I311f44a5035f73c0fb2289f727eb39b73007429b
Depends-On: I76c5b539bae5572c4ac65f28fec9c0c36381348c
Depends-On: Id4cbfc3b113b1b04f949d485187e89ffe0b487f5
Depends-On: I7d5ba4930688ed7f011a4babed5986b8e40910a0
Depends-On: I964f83ce88fb9c66a7c59037c6066f4567bcf4c9
Change-Id: I89504cfdf8e02831d54a26900bfdc63a33b4eade
2020-01-26 22:05:45 +00:00
jenkins-bot
a8a93df154 Merge "selenium: Replace wdio-chromedriver with ./selenium.sh script" 2020-01-26 21:51:21 +00:00
jenkins-bot
5e462e5efe Merge "Remove all traces of preprocessorClass from $wgParserConf" 2020-01-26 21:48:23 +00:00
jenkins-bot
03d44b77ad Merge "Support html+untidy tests and version flag in parserTests file" 2020-01-26 20:34:24 +00:00
jenkins-bot
f9a08c0c83 Merge "Remove Preprocessor_DOM, deprecated in 1.34" 2020-01-26 02:02:44 +00:00
C. Scott Ananian
0eb9f18d8d Remove all traces of preprocessorClass from $wgParserConf
Bug: T204945
Followup-To: I727f003f9a42d0c92bcbcce8a8289d5af6cd1298
Change-Id: I23821686ad666728d7d196e089f40be4b76b7390
2020-01-25 13:15:16 -05:00
C. Scott Ananian
2d4aced658 Remove Sanitizer::attributeWhitelist()/setupAttributeWhitelist()
These method were deprecated in 1.34 and should never have been public
in the first place.  New private methods have replaced them.

Code search:
https://codesearch.wmflabs.org/deployed/?q=attributeWhitelist%5C%28&i=nope&files=&repos=

Change-Id: I363530b7edaced77f2c5b06721b1930d85e2e9dc
2020-01-25 13:06:19 -05:00
C. Scott Ananian
5cbb64f56a Remove Preprocessor_DOM, deprecated in 1.34
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
2020-01-25 11:22:45 -05:00
Aaron Schulz
4fb5210b62 objectcache: fix storage of null values in WANObjectCache
Bug: T234583
Change-Id: I38a531b9a0acb95d7884519f3381b48cd9d8faa0
2020-01-24 22:49:26 +00:00
jenkins-bot
abc60d2f09 Merge "phpunit: fix parameter mangling" 2020-01-24 10:49:57 +00:00
jenkins-bot
a3855e4904 Merge "registration: Rewrite odd !(bool) cast in VersionCheckerTest" 2020-01-24 02:29:56 +00:00
Thiemo Kreuz
192025f569 registration: Rewrite odd !(bool) cast in VersionCheckerTest
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
2020-01-24 02:15:22 +00:00
jenkins-bot
7f54f8d3f3 Merge "JsonContent: align object key cells at the top" 2020-01-24 00:16:28 +00:00
Petr Pchelko
a136005a35 REST: /page/{title}/{bare,html,with_html} endpoints backed by RESTBase.
Bug: T234377
Bug: T234375
Change-Id: I77709c17e951e3efb542028e5c0d53eedda8c7bf
2020-01-23 11:55:20 -08:00
daniel
d996d69cd4 phpunit: fix parameter mangling
Options intended for MediaWiki must be removed from the argument list
including any arguments that follow them.

Bug: T243523
Change-Id: I8c29ca8c11a16bd43f534310a34bd1cc1f595287
2020-01-23 18:02:53 +01:00
jenkins-bot
146d1fee14 Merge "phpunit: Drop unused enforceTimeLimit command and related settings" 2020-01-23 12:54:49 +00:00
jenkins-bot
a1627bd9fc Merge "Upgrade to PHPUnit 8" 2020-01-23 11:19:46 +00:00
C. Scott Ananian
e7281ada17 Support html+untidy tests and version flag in parserTests file
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
2020-01-22 21:24:46 -05:00
James D. Forrester
194344a85b phpunit: Drop unused enforceTimeLimit command and related settings
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
2020-01-22 14:12:45 -08:00
Bill Pirkle
512b0b08d9 Add core REST API endpoint for media links
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
2020-01-22 15:10:44 -06:00
jenkins-bot
286cff8dc6 Merge "Allow multiple use of a HTMLElement/jQuery argument in jQueryMsg" 2020-01-22 16:34:52 +00:00
Daimona Eaytoy
2d6923b76c Upgrade to PHPUnit 8
Bug: T192167
Depends-On: I1bdf465ab6d5e400f64e5325bc03bd6d62f319c7
Change-Id: Ia12658554c94497a204b7f65f1a6f7b1fa0310ac
2020-01-22 15:44:18 +00:00
Michael Große
bb48ecbbc7 Allow multiple use of a HTMLElement/jQuery argument in jQueryMsg
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
2020-01-22 14:41:08 +01:00
Petr Pchelko
0a8aba4a9a Provide UIDgenerator::getTimestampFromUUIDv1 method
Returns a timestamp in desired format extracted from a UUIDv1.

Change-Id: I009241710654d4b0bc8a1a4b1f353ba815efc9f0
2020-01-21 13:26:13 -08:00