WMDE-Fisch has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392846 )

Change subject: Add tests for DiffEngine tooltips
......................................................................

Add tests for DiffEngine tooltips

Change-Id: I8e6560efc35a6bd875f96edb9b59c9961b81a956
---
M tests/phpunit/includes/diff/DifferenceEngineTest.php
1 file changed, 28 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/46/392846/1

diff --git a/tests/phpunit/includes/diff/DifferenceEngineTest.php 
b/tests/phpunit/includes/diff/DifferenceEngineTest.php
index 3a8f4db..57aeb20 100644
--- a/tests/phpunit/includes/diff/DifferenceEngineTest.php
+++ b/tests/phpunit/includes/diff/DifferenceEngineTest.php
@@ -1,5 +1,7 @@
 <?php
 
+use Wikimedia\TestingAccessWrapper;
+
 /**
  * @covers DifferenceEngine
  *
@@ -117,4 +119,30 @@
                $this->assertEquals( $revs[2], $diffEngine->getNewid(), 'diff 
get new id' );
        }
 
+       public function provideLocaliseTitleTooltipsTestData() {
+               return [
+                       'moved paragraph left shoud get new location title' => [
+                               '<a class="mw-diff-movedpara-left">⚫</a>',
+                               '<a class="mw-diff-movedpara-left" 
title="(diff-paragraph-moved-tonew)">⚫</a>',
+                       ],
+                       'moved paragraph right shoud get old location title' => 
[
+                               '<a class="mw-diff-movedpara-right">⚫</a>',
+                               '<a class="mw-diff-movedpara-right" 
title="(diff-paragraph-moved-toold)">⚫</a>',
+                       ],
+                       'nothing changed when key not hit' => [
+                               '<a class="mw-diff-movedpara-rightis">⚫</a>',
+                               '<a class="mw-diff-movedpara-rightis">⚫</a>',
+                       ],
+               ];
+       }
+
+       /**
+        * @dataProvider provideLocaliseTitleTooltipsTestData
+        */
+       public function testAddLocalisedTitleTooltips( $input, $expected ) {
+               $this->setContentLang( 'qqx' );
+               $diffEngine = TestingAccessWrapper::newFromObject( new 
DifferenceEngine() );
+               $this->assertEquals( $expected, 
$diffEngine->addLocalisedTitleTooltips( $input ) );
+       }
+
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/392846
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e6560efc35a6bd875f96edb9b59c9961b81a956
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: WMDE-Fisch <christoph.jau...@wikimedia.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to