aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/diff/DifferenceEngineTest.php
Commit message (Collapse)AuthorAgeFilesLines
* Avoid constructing Title objects in data providersdaniel2018-09-031-1/+19
| | | | | Bug: T202641 Change-Id: I34efa0b9329e740bcb292b2529ec8f7f925dc346
* Fix DifferenceEngine revision loading logicGergő Tisza2018-08-241-9/+14
| | | | | | Bug: T201218 Bug: T202454 Change-Id: I867900190cb45b983e89769c7fc0f965e2651918
* [MCR] Render multi-slot diffsGergő Tisza2018-08-201-0/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add tests for DiffEngine tooltipsWMDE-Fisch2017-11-221-0/+28
| | | | Change-Id: I8e6560efc35a6bd875f96edb9b59c9961b81a956
* Convert all array() syntax to []Kunal Mehta2016-02-171-13/+13
| | | | | | | | | | Per wikitech-l consensus: https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html Notes: * Disabled CallTimePassByReference due to false positives (T127163) Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
* tests: Clean up file headersTimo Tijhof2015-04-011-1/+0
| | | | | | | | | | * Remove redundant @licence/@license from test suite files. They already have full licence headers. And @licence raises a warning in Doxygen. * Fix weird messes of comments inside comments and other things. Change-Id: I38da8ca76330f72b8dc22b0ecf1ea69d5ea55ede
* Change @return to start with typeumherirrender2014-08-201-1/+1
| | | | | | | | | | | MediaWiki default is "@return type Description", so set a type after return and start the description with a capital letter. Also use the more common spelling of boolean. See http://phpdoc.org/docs/latest/references/phpdoc/tags/return.html for more about @return Change-Id: I4e5198822fe92836f9cef9918a9fc1a1a1e0a043
* Add tests for ArrayDiffFormatter and DiffOpaddshore2014-02-261-0/+1
| | | | | | | This change also adds some tested getters to the DiffOp class to improve testability of the class Change-Id: I26eafd791b9892f565a18d0502474ef9c24f9a29
* Make setUp and tearDown protected in testsaude2013-11-241-1/+1
| | | | | | | These are protected in the parent MediaWikiTestCase and PHPUnit_Framework_TestCase. No good reason to make them public. Change-Id: I45ecc0e4209f0c3b27e63a550112e4e0ddf6e530
* Fixed spacingumherirrender2013-11-191-3/+3
| | | | | | | | | | | - Removed double spaces - Added space after if/switch/foreach - Removed space on elseif - Added space around parentheses - Added newline at end of file - Removed space before semicolon at end of line Change-Id: Id40b87e04786c6111e6686d7f7eea1e588bdf37d
* use getOldid and getNewid methods in DifferenceEngineTestaude2013-10-311-2/+2
| | | | | | - instead of direct variable access. Change-Id: I019017ca1b4f3c2a511e703bc65b93a8ce47fae9
* Add tests for DifferenceEngine for revision loadingaude2013-10-301-0/+120
Change-Id: Ia206b396e96b52ba9ac4895aae0f2839dca6f958