From 3ad5a6d28a8ee5e1141861292c2528900ae0464a Mon Sep 17 00:00:00 2001 From: WMDE-Fisch Date: Wed, 22 Nov 2017 14:28:52 +0100 Subject: [PATCH] Add tests for DiffEngine tooltips Change-Id: I8e6560efc35a6bd875f96edb9b59c9961b81a956 --- .../includes/diff/DifferenceEngineTest.php | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/phpunit/includes/diff/DifferenceEngineTest.php b/tests/phpunit/includes/diff/DifferenceEngineTest.php index 3a8f4db309..57aeb20026 100644 --- a/tests/phpunit/includes/diff/DifferenceEngineTest.php +++ b/tests/phpunit/includes/diff/DifferenceEngineTest.php @@ -1,5 +1,7 @@ assertEquals( $revs[2], $diffEngine->getNewid(), 'diff get new id' ); } + public function provideLocaliseTitleTooltipsTestData() { + return [ + 'moved paragraph left shoud get new location title' => [ + '⚫', + '⚫', + ], + 'moved paragraph right shoud get old location title' => [ + '⚫', + '⚫', + ], + 'nothing changed when key not hit' => [ + '⚫', + '⚫', + ], + ]; + } + + /** + * @dataProvider provideLocaliseTitleTooltipsTestData + */ + public function testAddLocalisedTitleTooltips( $input, $expected ) { + $this->setContentLang( 'qqx' ); + $diffEngine = TestingAccessWrapper::newFromObject( new DifferenceEngine() ); + $this->assertEquals( $expected, $diffEngine->addLocalisedTitleTooltips( $input ) ); + } + } -- 2.20.1