From 96e1167d92b56161009025f9884e39317aeeddb1 Mon Sep 17 00:00:00 2001 From: addshore Date: Wed, 27 Jan 2016 19:56:09 +0100 Subject: [PATCH] Give TestCase::checkHasDiff3 a better name This method actually marks the test it is called from as skipped if Diff3 is not confugured. The new name "markTestSkippedIfNoDiff3" better reflects that. Change-Id: I1dffeba0aceb312b3a82216f0b55227e24bc2e34 --- tests/phpunit/MediaWikiTestCase.php | 2 +- tests/phpunit/includes/EditPageTest.php | 2 +- tests/phpunit/includes/GlobalFunctions/GlobalTest.php | 2 +- tests/phpunit/includes/content/WikitextContentHandlerTest.php | 2 +- tests/phpunit/includes/page/WikiPageTest.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index 861e3bd864..f69e342ad4 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -1026,7 +1026,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { * * @since 1.21 */ - protected function checkHasDiff3() { + protected function markTestSkippedIfNoDiff3() { global $wgDiff3; # This check may also protect against code injection in diff --git a/tests/phpunit/includes/EditPageTest.php b/tests/phpunit/includes/EditPageTest.php index 804b6ba405..ac745f2a42 100644 --- a/tests/phpunit/includes/EditPageTest.php +++ b/tests/phpunit/includes/EditPageTest.php @@ -463,7 +463,7 @@ hello public function testAutoMerge( $baseUser, $text, $adamsEdit, $bertasEdit, $expectedCode, $expectedText, $message = null ) { - $this->checkHasDiff3(); + $this->markTestSkippedIfNoDiff3(); // create page $ns = $this->getDefaultWikitextNS(); diff --git a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php index 56f97469ae..d1749472a0 100644 --- a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php +++ b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php @@ -469,7 +469,7 @@ class GlobalTest extends MediaWikiTestCase { * @covers ::wfMerge */ public function testMerge( $old, $mine, $yours, $expectedMergeResult, $expectedText ) { - $this->checkHasDiff3(); + $this->markTestSkippedIfNoDiff3(); $mergedText = null; $isMerged = wfMerge( $old, $mine, $yours, $mergedText ); diff --git a/tests/phpunit/includes/content/WikitextContentHandlerTest.php b/tests/phpunit/includes/content/WikitextContentHandlerTest.php index 361238b709..6b7a210b9f 100644 --- a/tests/phpunit/includes/content/WikitextContentHandlerTest.php +++ b/tests/phpunit/includes/content/WikitextContentHandlerTest.php @@ -157,7 +157,7 @@ class WikitextContentHandlerTest extends MediaWikiLangTestCase { * @covers WikitextContentHandler::merge3 */ public function testMerge3( $old, $mine, $yours, $expected ) { - $this->checkHasDiff3(); + $this->markTestSkippedIfNoDiff3(); // test merge $oldContent = new WikitextContent( $old ); diff --git a/tests/phpunit/includes/page/WikiPageTest.php b/tests/phpunit/includes/page/WikiPageTest.php index 7c0dd2ecf9..6d2b398ef5 100644 --- a/tests/phpunit/includes/page/WikiPageTest.php +++ b/tests/phpunit/includes/page/WikiPageTest.php @@ -816,7 +816,7 @@ more stuff /* @todo FIXME: fix this! public function testGetUndoText() { - $this->checkHasDiff3(); + $this->markTestSkippedIfNoDiff3(); $text = "one"; $page = $this->createPage( "WikiPageTest_testGetUndoText", $text ); -- 2.20.1