aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/diff/TextSlotDiffRendererTest.php
diff options
context:
space:
mode:
authorjdlrobson <jdlrobson@gmail.com>2019-10-29 16:30:32 -0700
committerJdlrobson <jrobson@wikimedia.org>2019-12-06 01:08:10 +0000
commit1c2de3d39759ccff5f987f9ec2208cd081d66630 (patch)
tree32dc9d15486f941e5397eceb1abfe59fd1b8918c /tests/phpunit/includes/diff/TextSlotDiffRendererTest.php
parent7731054ab708a2ca4f7f83232333b96c401bd92b (diff)
downloadmediawikicore-1c2de3d39759ccff5f987f9ec2208cd081d66630.tar.gz
mediawikicore-1c2de3d39759ccff5f987f9ec2208cd081d66630.zip
Inline diffs upstreamed from MobileFrontend to core.
A new inline mode is provided for diffs. It is only available when wikidiff2 is installed. There is no PHP implementation (one can be added later if necessary) For now, it is accessed by passing diff-type as a query string parameter e.g ?diff-type=inline A control for switching between the two is added as a follow up. see Ie9bb17789d90b7492559782021937f3f3e4356f8 * The final method getSlotDiffRenderer now takes a second parameter options * The method `getSlotDiffRendererInternal` is deprecated and replaced with the more flexible `getSlotDiffRendererWithOptions` This has potential to be a breaking change but is unlikely to impact any existing clients. Note: PHP implementation can be added later if necessary Bug: T117279 Change-Id: I4f81c8ccf253dd4aa6cf43c3fad257b4b0dd1ebd
Diffstat (limited to 'tests/phpunit/includes/diff/TextSlotDiffRendererTest.php')
-rw-r--r--tests/phpunit/includes/diff/TextSlotDiffRendererTest.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/phpunit/includes/diff/TextSlotDiffRendererTest.php b/tests/phpunit/includes/diff/TextSlotDiffRendererTest.php
index 570cedea70e6..8437c1c8152c 100644
--- a/tests/phpunit/includes/diff/TextSlotDiffRendererTest.php
+++ b/tests/phpunit/includes/diff/TextSlotDiffRendererTest.php
@@ -8,6 +8,15 @@ use Wikimedia\Assert\ParameterTypeException;
*/
class TextSlotDiffRendererTest extends MediaWikiTestCase {
+ public function testGetExtraCacheKeys() {
+ $slotDiffRenderer = $this->getTextSlotDiffRenderer();
+ $key = $slotDiffRenderer->getExtraCacheKeys();
+ $slotDiffRenderer->setEngine( TextSlotDiffRenderer::ENGINE_WIKIDIFF2_INLINE );
+ $inlineKey = $slotDiffRenderer->getExtraCacheKeys();
+ $this->assertSame( $key, [] );
+ $this->assertSame( $inlineKey, [ phpversion( 'wikidiff2' ), 'inline' ] );
+ }
+
/**
* @dataProvider provideGetDiff
* @param array|null $oldContentArgs To pass to makeContent() (if not null)