aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/diff/TextSlotDiffRendererTest.php
Commit message (Collapse)AuthorAgeFilesLines
* Deprecate $wgWikiDiff2MovedParagraphDetectionCutoffAdam Wight2019-05-221-1/+0
| | | | | Bug: T194272 Change-Id: I174192dc2b91409e023c06b054bc1bba8bfc571f
* SlotDiffRenderer: add utility method for parameter type checksGergő Tisza2018-09-241-2/+4
| | | | Change-Id: I0161070fd0330d4945cec2f76f4fd8128a9793b9
* [MCR] Render multi-slot diffsGergő Tisza2018-08-201-0/+113
Move logic for rendering a diff between two content objects out of DifferenceEngine, into a new SlotDiffRenderer class. Make DifferenceEngine use multiple SlotDiffRenderers, one per slot. This separates the class tree for changing high-level diff properties such as the header or the revision selection method (same as before: subclass DifferenceEngine and override ContentHandler::getDiffEngineClass or implement GetDifferenceEngine) and the one for changing the actual diff rendering for a given content type (subclass SlotDiffRenderer and override ContentHandler::getSlotDiffRenderer or implement GetSlotDiffRenderer). To keep B/C, when SlotDiffRenderer is not overridden for a given content type but DifferenceEngine is, that DifferenceEngine will be used instead. The weak point of the scheme is overriding the DifferenceEngine methods passing control to the SlotDiffRenderers (the ones calling getDifferenceEngines), without calling the parent. These are: showDiffStyle, getDiffBody, getDiffBodyCacheKeyParams. Extensions doing that will probably break in unpredictable ways (most likely, only showing the main slot diff). Nothing in gerrit does it, at least. A new GetSlotDiffRenderer hook is added to modify rendering for content models not owned by the extension, much like how GetDifferenceEngine works. Also deprecates public access to mNewRev/mOldRev and creates public getters instead. DifferenceEngine never supported external changes to those properties, this just acknowledges it. Bug: T194731 Change-Id: I2f8a9dbebd2290b7feafb20e2bb2a2693e18ba11 Depends-On: I04e885a33bfce5bccc807b9bcfe1eaa577a9fd47 Depends-On: I203d8895bf436b7fee53fe4718dede8a3b1768bc