Commit graph

40 commits

Author SHA1 Message Date
Amir Sarabadani 30a5b88ea1 Use ExtensionRegistry instead of class_exists
Bug: T183096
Change-Id: I963704cdcfdbc97727f435eb16998c16c692ed01
2017-12-29 00:12:30 +01:00
Kunal Mehta 9095d5bcb5 Use namespaced ScopedCallback
The non-namespaced version is deprecated since 1.28

Change-Id: Iac0b120ccda77065a480e9461e7fcbd19d55f1db
2017-08-21 14:05:11 -07:00
MusikAnimal fdd1fe6d22 Duplicate new table from core, patch 349457
With 349457, anytime a revision is created, a corresponding record
is created in the new ip_changes table. This may cause tests to fail
if they don't drop the ip_changes table between individual tests.

https://gerrit.wikimedia.org/r/#/c/349457/

Change-Id: I48f0b64f19f9582b40540fa1b42a39d281979625
2017-08-11 15:51:03 -04:00
Kunal Mehta aaf061c725 build: Updating mediawiki/mediawiki-codesniffer to 0.9.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.ExtraParamComment
* 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.NamingConventions.LowerCamelFunctionsName.FunctionName
* MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment

Change-Id: I8401abf121a7413fa191d7bc535e0ddd6cf8c3f7
2017-06-22 14:13:28 +00:00
Gergő Tisza 39ba452b32 Switch TestingAccessWrapper to librarized version
Bug: T163434
Change-Id: Ib5aeffb793cfd84201ca397a96689e0b81f3265f
Depends-On: I52cc257e593da3d6c3b01a909e554a950225aec8
2017-04-20 11:34:57 +00:00
WMDE-Fisch eb81a1c0f1 Avoid unintended mentions when changing content
When content is changed and the change contains the signature
of the user, the method checking for reasonable mentions in
that changes did not consider multiple signatures.

The patch fixes that and adds a test for it.

Bug: T154406
Change-Id: I86303f42e97d16c68e3235b0e2d13542ceedf1fe
2017-03-01 11:58:08 +00:00
jenkins-bot 387d0dc010 Merge "DiscussionParserTest only create users when needed" 2017-02-24 13:17:03 +00:00
WMDE-Fisch 71e3b66cc0 Remove test for internal diff engine acceptance
Since the internal diff engine is now always used this test
seems to be unnecessary.

Bug: T93625
Change-Id: I536474dc6231138293c9efc813a1bc2cc1e6f3b0
2017-02-24 11:32:37 +00:00
addshore 6d4021915f DiscussionParserTest only create users when needed
This speeds up the tests from 2 mins to 50 seconds for me.
(with a slow setup, no caching etc.)

Bug: T158120
Change-Id: I8adb6c8fe783d1be8841a1139bb141da3b046f9d
2017-02-24 11:10:22 +01:00
Umherirrender 3a72d87838 Remove unused DiscussionParser::stripIndents
Change-Id: I75fbcae70655c6db2873fd5e22d11a3c2cbf2f84
2017-02-22 18:05:07 +01:00
WMDE-Fisch d6f011aa1a Fix mentions failing editing empty pages
For the used diff engines an empty/new page is equivalent
to an empty line. When adding content that includes an
empty line the content will be split into two parts. The
interpreted diff will then consist of one addition, one
copied line and another addition.

Is the ping in the first addition and the signature in the
second addition the DiscussionParser does not send mentions.

The patch introduces a special case when interpreting diffs
if content is added to empty content. This will also skip
execution off diff engines since the interpretation is trivial.

Bug: T155998
Change-Id: Id5e44bc3245940c1f77c80f036db637756542552
2017-02-10 14:39:13 +00:00
James D. Forrester 8c810dff48 build: Update mediawiki/mediawiki-codesniffer to 0.7.1
Also added "composer fix" command.

Change-Id: I25cb61b3b92798f1259d1575a336e2b056d5764f
2016-12-05 15:54:30 -08:00
Jakob Warkotsch 3da89ea4d9 Send notification for mentions on changes
This sends out a notification when a user gets mentioned in a change as
long as a signature is added in the same section.

Bug: T138938
Change-Id: Ie183fbb8150bd9451a5b0a9fea0227e3241b26a0
2016-09-14 12:36:22 +02:00
WMDE-Fisch 4ac1711be8 Send mentions when editing multiple sections in between sections.
This patch fixes mentions not being send when multiple sections were added
in between sections.

Since we only want to send mentions when userlinks and signature are present
in the same section a new method was added extracting sections and the related
content from an addition. The results are checked whether a section content
contains a signature and might be relevant for mentions.

Bug: T141863
Change-Id: I434c664552bbadbeef6e897e20703e813f5a4c52
2016-09-08 15:15:14 +02:00
Stephane Bisson c75d974004 Provide title when parsing wikitext
Bug: T141460
Change-Id: I802c9c4bf964a060e44f25a487b5aec6f7d8c6b6
2016-09-01 16:48:56 -04:00
jenkins-bot f48b44bacd Merge "Log edits in multiple sections that could trigger mentions." 2016-08-19 22:00:43 +00:00
jenkins-bot d35c5825d8 Merge "Always use php based diff in EchoDiscussionParserTest" 2016-08-19 15:11:38 +00:00
addshore 5dd9858f4e Always use php based diff in EchoDiscussionParserTest
The previous check here meant that different
setups could run these tests with current diff
engines thus these tests could result in different
successes / failures.

Change-Id: I62a52dee1dd1ecd2ebd36e1aa540245e90a57ddd
2016-08-19 13:34:54 +01:00
WMDE-Fisch 66ecc1f0e7 Log edits in multiple sections that could trigger mentions.
This patch logs multiple section edits that could trigger mentions.

Since we only want to send mentions when userlinks and signature are present
in the same section a new method was added extracting sections and the related
content from an addition. The results are checked whether a section content
contains a signature and might be relevant for mentions.

Bug: T141863
Change-Id: Ib06cd855b2c7fbd51d8ab6602882cb38aadf8350
2016-08-18 14:58:00 +02:00
WMDE-Fisch c81e1b93d2 Fix mention failures not beeing sent.
While manual rebasing the bundle patch the wrong
line was removed.

Also improves tests to check for notifyAgent.

See I1069aeb5523db8710da4e8e21065bf447d031e3c

Change-Id: I33ddeccea153d6f6ae97e5c60e8b47dc24fb4833
2016-08-15 14:25:22 +02:00
jenkins-bot cf3e03edc9 Merge "Revert "Allow self mentions"" 2016-08-12 01:48:03 +00:00
Mattflaschen 59568789fa Revert "Allow self mentions"
This reverts commit 0e23463185.

Change-Id: I4389c7b93b2bbc117931a263b58a8f1cc30dca6c
2016-08-12 01:41:08 +00:00
jenkins-bot 189d84d01d Merge "Allow self mentions" 2016-08-04 22:53:54 +00:00
addshore 61e9957a95 Add extra case to EchoDiscussionParserTest::testGetSectionCount
Change-Id: Iaec5b891df256955f3e24c8251e5f2e2881f469b
2016-08-04 00:20:22 +00:00
addshore b09cba54c2 Remove unused generateUserIdsForValidUserMentions in test
Change-Id: I78bdd6c9a0cb0ce823ca09379c8152c9c034c237
2016-08-03 17:17:36 -07:00
addshore 5ee7d74c6d Add test for EchoDiscussionParser::extractHeader
Change-Id: Ie4a05e58fafd9d852b2a27fe2ac8f2930b03d2f0
2016-08-03 18:01:57 +00:00
addshore 0e23463185 Allow self mentions
Bug: T138080
Change-Id: I8832f71559741787084bc06e1f7c5ea0f7918d82
2016-08-03 12:38:34 +01:00
WMDE-Fisch 547abe3bdb Add tests for events on multiple sections edits
Mainly as preparation for future patches touching that issue.

Change-Id: I80fd885cbf670e0e3252e38b85703c9d052b3056
2016-08-02 17:15:31 +02:00
WMDE-Fisch 78632108fd Echo notifications for successful mentions
Adds new notification type and icon for successful mentions.
Complements existing test to consider successful mentions.

Bug: T139623
Change-Id: I7a77b40e8b14c95cadb9023065ee916247feacf9
2016-08-01 13:40:55 +02:00
WMDE-Fisch 86d3352464 Refactored generation of mention events.
To increase reusability in future changes.

Change-Id: Ia56f4c587361f0214d738cdf690cf9abf93a2021
2016-07-29 14:49:09 +02:00
WMDE-Fisch 4c7e5d2669 Rename mention-too-many failure notification.
Change-Id: I49041bd01697ae4c160766f194c92ff3d7a4a989
2016-07-27 16:41:29 +00:00
WMDE-Fisch 868190bbf6 Echo notifications for mention failures
- Adds global "$wgEchoMentionStatusNotifications"
   to activate mention status notifications.
   (must be set before extension is loaded)
 - Adds notification types and icon for some basic mention
   failures.
 - Adds failure and stats for anonymous IP.
 - Adds check for links to user subpages.
 - Adds config var for max mention notifications allowed.
 - Bundles notifications.
 - Refactors test for the event generation and adds tests
   for unknown users, user links with subpages and failures
   for too many mentions.

Bug: T136326
Change-Id: I388bdc3714feb9a2865a5ad10dbeabb0a6a09a4f
2016-07-27 13:00:25 +02:00
Kunal Mehta 1a189964bc Reset the TitleParser service without messing up the database
Calling MediaWikiTestCase::setService() appears to mess up the database,
so just reset it directly with MediaWikiServices, and tear it down to
avoid leaking any state.

Change-Id: Ibfd0a7f98f50506cd8402f966682f320bf715c8a
2016-05-11 10:13:01 -07:00
Kunal Mehta 1baa72cf08 Reset TitleParser service after modifying $wgContLang
Needed by I81d48616afd1ab2bde1a5f1d12f4aefb1c866d43

Change-Id: Ic64b0c45b7e6b8420874385f952a0dc4a93e0149
2016-05-11 09:04:33 -07:00
Brad Jorsch 406deaec3f Recreate test users for every test
The assumption currently made that "we only need to add these users
once" is only because of a hack in MediaWikiTestCase that is being
removed in If251739f.

Bug: T132411
Change-Id: I4924ae941b3844b39dd3f44c6986c3bf29b0d62a
2016-04-12 11:42:22 -04:00
James D. Forrester 7f7e6b8159 build: Enable phpcs rule 'PSR2.Methods.MethodDeclaration.StaticBeforeVisibility' and make pass
Change-Id: Iff0709c3a30f8c39d54bab2361e109c96aea6aa0
2015-10-29 13:06:43 +01:00
James D. Forrester 18969bf227 build: Enable phpcs rule 'Generic.Functions.FunctionCallArgumentSpacing.SpaceBeforeComma' and make pass
Change-Id: I5493cb692525ab6c0d560aebbe131f40b6016232
2015-10-29 12:57:02 +01:00
Siebrand Mazeland 33126b69aa Update formatting
In preparation of Code Sniffer based updates.

Change-Id: Id5d43332b44a37665d57dc24ef8c432bc65b2f6a
2015-10-03 23:28:54 -04:00
Kunal Mehta 3a1883f3db Add test case to demonstrate T68512 is fixed
Change-Id: Icadf33455aa09147e7f42809a9c36794ec7abd82
2015-07-06 17:31:08 -07:00
Kunal Mehta c1c91a0c1d Update tests/phpunit for new directory structure
Change-Id: Ic2d5659bb1db89cb62d3703ce59f3e58ba909886
2015-06-15 11:36:02 -07:00
Renamed from tests/phpunit/includes/DiscussionParserTest.php (Browse further)