Commit graph

65 commits

Author SHA1 Message Date
libraryupgrader 081ad97a0c build: Updating mediawiki/mediawiki-codesniffer to 31.0.0
Additional changes:
* Replaced "jakub-onderka" packages with "php-parallel-lint".

Change-Id: I1f3e80ffbcdf2526a6533af6d7008d9f3456531c
2020-05-30 08:23:03 +00:00
DannyS712 80fe5f9228 Use new signature for WikiPage::doDeleteArticleReal in MW 1.35+
Bug: T247869
Change-Id: I606611d2cf5cd77c8cef68cc96def9207d2e5940
2020-03-25 06:45:15 +00:00
Daimona Eaytoy 3d2441cfef Avoid using Title::__construct
Change-Id: Ic78da7e9f417ee64288537e008068949edb1fbac
2020-03-07 13:15:12 +00:00
DannyS712 7de45d5f5c Remove use of ApiTestCase::doLogin
Bug: T244039
Change-Id: I5ce8bebc22d15bc40f2704a2dfec6f0757fb0034
2020-02-03 19:17:51 +00:00
DannyS712 9f25a0b64e Remove use of global $wgUser
Reword ApiCoreThankIntegrationTest::testLogThanksForADeletedLogEntry
to avoid needing to use it

Also remove one use of doLogin(), remaining will be removed separately

Bug: T243874
Bug: T244039
Change-Id: I6cf26839cb4e3042408fb6b059fb877b605763e8
2020-02-01 01:11:40 +00:00
Ed Sanders c033679cb8 build: Update eslint-config-wikimedia
Change-Id: I3cbcbb1695896ddc1e54c40dc0da50f91944916f
2019-12-12 11:36:24 +00:00
Max Semenik 469117ff28 tests: getMock() is deprecated
Bug: T192167
Change-Id: I460f9c5457483b9350c4f88c24d24425fd46a9a8
2019-10-21 22:18:33 -07:00
Daimona Eaytoy 2b81f0333f Clean up some PHPUnit 4 bc stuff
Bug: T192167
Change-Id: I5b08e479329503ee651580005fe7347f22939ca4
2019-10-13 11:41:05 +02:00
Max Semenik be060b3d07 tests: setExpectedException() is deprecated
Change-Id: Ie9500ff2dabb9315f6fe8344acdfbb1f3f1aac33
2019-10-12 15:55:31 -07:00
James D. Forrester 951d171e6b build: Upgrade mediawiki-codesniffer to v28.0.0
Change-Id: I67fef60b34f8d2b6f5e4920a3caf99bef75fd214
2019-10-11 12:16:59 -07:00
Derick Alangi 649d070d22 Fix function name mismatch, wfWikiId() -> wfWikiID()
Change-Id: I78df6e6bbd19315bb4dc7bcb41b3506a182ce8bb
2019-08-31 21:07:14 +01:00
Thalia a95e0e2b91 Use MediaWiki\Block\DatabaseBlock instead of Block
This follows the rename of the Block class in I6d96b63ca0.

Change-Id: I6c0244987a9b2b1d62efabc2da78b79711dad878
2019-05-31 16:44:56 +01:00
jenkins-bot 182fe138e0 Merge "Allow partially blocked users to use Thanks" 2019-05-30 21:02:03 +00:00
Vedmaka 6684b5aaaa Support for PermissionManager changes at
https://gerrit.wikimedia.org/r/c/mediawiki/core/+/502484

Change-Id: Ie4cedf457eaaa93ec3055c37539322855e02ce26
2019-05-28 09:33:32 +00:00
Thalia 810de9afbd Allow partially blocked users to use Thanks
Only prohibit users from using Thanks if they are blocked from the
associated page. This allows partially blocked users to use thanks
most of the time.

It also allows blocked users to thank on their own talk page, if
they are allowed to edit it, even if they are sitewide blocked.

Bug: T221371
Change-Id: Ic99ec38ea200e806963951b2dd67e56ecde63752
2019-05-22 22:05:33 +01:00
Umherirrender e0be7340bd Use ExtensionRegistry rather than class_exists
Change-Id: I5dd3acc4fff6a0a59693c5258138c4b2aa139cf8
2019-03-03 02:36:06 +01:00
Matěj Suchánek 0f009ccbba Migrate to new phan
Bug: T216945
Change-Id: If2696959e31a0f2358f6289922b6b3ef3ebc5291
2019-02-24 18:15:31 +01:00
jenkins-bot 5d5b82ad65 Merge "Thanks/thank: Add tests for thanked cookie and getUserGender()" 2018-11-16 18:15:38 +00:00
takidelfin 957ee53679 Thanks/thank: Add tests for thanked cookie and getUserGender()
Added two new tests: thanked cookie and gets user gender. First uses jQuery cookies and second uses Sinon fake server

Bug: T160267
Change-Id: I8f5dad9c90e930d557e86acb4b175ec549849e7a
2018-11-16 17:50:58 +01:00
Ed Sanders 18011b81c2 build: Update devDependencies
Change-Id: I4fc1204a4226be26c0bd7f06a06ed57f13c58b6f
2018-11-12 19:27:37 +00:00
Ed Sanders e453114f55 Remove obsolete aliases from closures
Bug: T208951
Change-Id: Ie84c06e4a69923a5993b173d490bfa97189c285b
2018-11-12 19:22:46 +00:00
jdlrobson a6fa3c4977 Do not use PNG for thanks button
Instead use mediawiki.ui and ResourceLoaderImageModule

Other changes:
* Add gender support to thanks-button-thanked

Depends-On: I0745e112d11026ed59d8daca990b313305cd094a
Bug: T198151
Change-Id: I82ae596330aff8387653c65a6bab5ff729641a80
2018-08-09 17:13:21 +00:00
Reedy 64ad66c8d4 s/@gropu/@group/
Change-Id: Ie407283a57e925a819e6365895153917e1ea3447
2018-06-04 07:29:04 +00:00
Kunal Mehta e696cba57f Add phan configuration
Change-Id: I6d0a0823404e5e50819ae0997b7d2c5267a4e144
2018-04-09 00:12:28 -07:00
Roan Kattouw 5f9f913fb6 ApiCoreThankIntegrationTest: Fix intermittent failures
Every time the setup function runs, it chooses a random page name with
random content. If it chooses a page name + content combination that was
used to set up a different test in the same run, the edit it makes will
be a null edit, the revid will be null, and the test will crash.

There are 100 possible page names and 100 possible page texts, so 10k
possibilities total, and the setup function appears to be called 10 times,
so the probability of a collision would have been
(10 choose 2)/10000 = 0.0045 = 0.45%, or one in every 222 times.

Bug: T151878
Change-Id: I800ee8512c2ad171ba793bea343f456653f9a16d
2018-03-19 18:03:27 -07:00
Max Semenik ed087b044c Reintroduce the API to thank for log entries
Originally introduced in b84eedc74e, it was reverted for security concerns.
New changes:
* Instead of bundling the log summary with notification, load it on display
* If the log event has been suppressed after the thanks for it has been sent,
  silently delete the event to prevent the confusion of linking to something
  zapped.
* Keep the 'already sent' cache key compatible with old format
* Validate the log id in the API
* Change ApiCoreThank::getRevisionFromParams() to ApiCoreThank::getRevisionFromId()

Bug: T186855
Bug: T188791
Depends-On: Ic5e9db0def857d9dcecbd06bf081c8c83712c1ea
Change-Id: I03aea7d9f4dfa0fe49639c53968deabf89999d2d
2018-03-06 13:08:47 +08:00
MaxSem 3b2397fea9 Revert "Add support to the Thanks API for thanking log entries"
This reverts commit b84eedc74e.

Bug: T188791
Change-Id: If55ed6cbb5da34c0034da3cc564c6a8ff82448d2
2018-03-02 22:59:20 +00:00
Sam Wilson b84eedc74e Add support to the Thanks API for thanking log entries
Add a 'log' API parameter (for the log ID to thank), and add
a whitelist config variable for specifying which log types are
thankable.

Bug: T186855
Change-Id: I58ae90c9729c0066f952e90fca2cf99b029d0d9b
2018-03-01 14:57:57 -08:00
Sam Wilson 78831d2b68 Rename files and classes in preparation for adding log-thanks
Bug: T186855
Change-Id: I20f5d200c33e395aca9489b73d0ed9b1d0ad5b8c
2018-02-21 12:49:21 +08:00
Sam Wilson 2e7e5e0190 Move classes to includes/ and rename some to match class names
For conformance to coding standards. This removes an exclusion
from the phpcs config.

Change-Id: I1481a3e7e68a81daf310ea3c7bf9dc48cdaf140b
2018-01-30 10:32:03 +08:00
Sam Wilson 55ceeb3fbe Fix member variable visbility and doc
Change-Id: I22d16b05d24c615f0c792063e33433d50a34ad8a
2018-01-19 16:38:58 +08:00
James D. Forrester 6bf8fd0b11 tests: Make compartible with QUnit 2
Change-Id: I726d7f75e37a759e1b1f6372710cb06f754fc94b
2017-10-23 13:38:11 -07:00
James D. Forrester e315e954a6 build: Replace jshint and jscs with eslint; drop csslint
Removing csslint rather than replacing it with stylelint as there
are no CSS or LESS files in this repo.

Also bumping banana and jsonlint to latest.

Change-Id: I9ffce273f63b061e07c3fa90ab4e82b5e551aa92
2017-08-03 17:24:34 -07:00
Kunal Mehta e2f4f28e3d build: Updating mediawiki/mediawiki-codesniffer to 0.9.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingParamComment
* MediaWiki.Commenting.FunctionComment.MissingParamName
* MediaWiki.Commenting.FunctionComment.MissingParamTag
* MediaWiki.Commenting.FunctionComment.MissingReturn
* MediaWiki.Commenting.FunctionComment.ParamNameNoMatch
* MediaWiki.Commenting.FunctionComment.WrongStyle
* MediaWiki.FunctionComment.Missing.Protected
* MediaWiki.FunctionComment.Missing.Public
* MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment

Change-Id: I6b5140bfdacab7a7ba23c7ba65e7e9f732c780a0
2017-06-25 13:54:10 +00:00
Brad Jorsch a9cbd9471b Update for API error i18n
See Iae0e2ce3. Since Thanks master requires core master, this just
depends on the master patch instead of trying to maintain BC.

Depends-On: Iae0e2ce3bd42dd4776a9779664086119ac188412
Change-Id: Ib6e66f7e94c41b7a27fe867f079626ac0ade4f1b
2016-11-15 03:22:14 +00:00
Brad Jorsch b40e7197e1 Prepare for API error i18n
This has the minimal changes necessary for unit tests to pass with
Iae0e2ce3.

Change-Id: I535344c29d51521147c2a26c341dae38cec3e931
2016-11-15 03:20:58 +00:00
Reedy b96f1a8b70 Remove 'UnitTestList' hook
No longer needed now that extension unittests are autodiscovered.

Bug: T142120
Bug: T142121
Change-Id: Ic856aa0d3d7af53f1405ceee43aff41bface3b58
2016-08-05 17:40:28 +01:00
Stephane Bisson d4502c4c3a flow-thank: add a target-page entry for the topic page
The target-page entry allows locating those notifications
when the topic is moderated.

Bug: T93673
Change-Id: Ibe6bfda424b3ba2199efd712a5be194da4d5e6f2
2016-07-28 11:24:24 -04:00
Ori Livneh 9cb10b050e Update test for API change in PS10 of I17ef1f5197
Use $this->getMutableTestUser() instead of $this->getTestUser( true ).

Change-Id: Idb41b4842d0c95801dcd5476fa2f3e45153f9c71
2016-05-23 20:16:08 -07:00
Ori Livneh 111f48f982 Update tests for I17ef1f519
This is a prerequisite for I17ef1f519, since the tests break otherwise. The
change is backward-compatible since it checks for the presence of the
getTestUser method introduced by that change.

Change-Id: I8bbc9ebf32a89157fa9c60fd33151a10e7598af8
2016-05-24 02:38:12 +00:00
addshore 5c0b21593f Make revisions in setUp for ApiRevThankIntTest
Bug: T134582
Change-Id: I5317616f99f1344557fd818d0b00073a82197d05
2016-05-07 11:54:04 +00:00
addshore 6d470cad44 Rename ApiRevThankTest to reflect file name
Change-Id: I4b99e42999416643e17a8bcebe7bf00e70ca18ef
2016-05-06 15:23:30 +01:00
James D. Forrester 03b8f88fff build: Add doxygen, use composer for phpcs, make pass
Change-Id: I939d6f4d989cf21c0f817d262bf3e4acedcf2ffe
2016-04-25 15:42:04 +00:00
Kunal Mehta 9aa92841a6 Fix ApiRevThankTest::testValidRequest()
Bug: T130973
Change-Id: I3fc094fa0aeb7d5928fd8033bc3eefbceea72e16
2016-03-29 15:12:49 -07:00
addshore 57236b1809 @author Addshore everywhere for me
Change-Id: I424b8ba94a46d1ad430914aaf8d883af0df712a1
2016-01-27 11:06:17 +01:00
Glaisher 703642e40e Hide thanks button for botedits if bots are not allowed to receive thanks in mobile as well
Also only load 'ext.thanks.mobilediff' module if the recipient is not an IP.

Bug: T118686
Change-Id: I096d3b05a46590db426ae038f17f6e180fa5bf37
2015-11-24 22:47:56 +05:00
addshore 9b864432fd Remove use of deprecated TestUser->user
Change-Id: I10f1809b08a6c39685dc3af8088019483f307e6d
2015-08-11 01:27:50 +00:00
Matthias Mullie ddf1310eea Flow container needs to be reset before each test
Pimple throws an exception when overriding something that was
already fetched from container.
This is currently causing some extensions trouble.

To prevent shared state between tests the flow container 
needs to be reset in the setUp() routine of all tests
accesing the container.

Bug: T91967
Change-Id: Ic80b137e6ca2f8ba6ad34ce0bdbb1319b81c0a6e
2015-03-09 17:27:01 +00:00
jdlrobson e02c334880 Add tests for rendering of thanks button on mobile diff page
This has broken many times and I want this test to ensure its protection
in future.

Bug: T86687
Change-Id: Iea01c5c7c1ba00de47182521eeba86c8aef03522
2015-01-28 12:48:08 -08:00
Brad Jorsch a0e4ccfa30 Add i18n for API module help
MediaWiki core change I04b1a384 added support for i18n of API module
help. This takes advantage of that while still maintaining backwards
compatibility with earlier versions of MediaWiki.

Once support for MediaWiki before 1.25 is dropped, the methods marked
deprecated in this patch may be removed.

Change-Id: I67395aff48185f3e09da31b51a08aa2541fe6a17
2014-11-03 13:32:23 -08:00