X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fdiff%2FDifferenceEngineTest.php;h=43fe53fb74a5a06b3a2cead95c34db804f64d724;hp=c1bb1a0d386a0df9beda9278bb50900680c6ef70;hb=407d50c860fa5ff73cf342ca74b1a321e628eab5;hpb=f5360c82b810a05b35e8de3f983ecf2deea1961a diff --git a/tests/phpunit/includes/diff/DifferenceEngineTest.php b/tests/phpunit/includes/diff/DifferenceEngineTest.php index c1bb1a0d38..43fe53fb74 100644 --- a/tests/phpunit/includes/diff/DifferenceEngineTest.php +++ b/tests/phpunit/includes/diff/DifferenceEngineTest.php @@ -32,6 +32,8 @@ class DifferenceEngineTest extends MediaWikiTestCase { if ( !self::$revisions ) { self::$revisions = $this->doEdits(); } + + $this->setMwGlobals( [ 'wgDiffEngine' => 'php' ] ); } /** @@ -165,12 +167,6 @@ class DifferenceEngineTest extends MediaWikiTestCase { $oldContent = ContentHandler::makeContent( ...$oldContentArgs ); $newContent = ContentHandler::makeContent( ...$newContentArgs ); - // Set $wgExternalDiffEngine to something bogus to try to force use of - // the PHP engine rather than wikidiff2. - $this->setMwGlobals( [ - 'wgExternalDiffEngine' => '/dev/null', - ] ); - $differenceEngine = new DifferenceEngine(); $diff = $differenceEngine->generateContentDiffBody( $oldContent, $newContent ); $this->assertSame( $expectedDiff, $this->getPlainDiff( $diff ) ); @@ -187,12 +183,6 @@ class DifferenceEngineTest extends MediaWikiTestCase { } public function testGenerateTextDiffBody() { - // Set $wgExternalDiffEngine to something bogus to try to force use of - // the PHP engine rather than wikidiff2. - $this->setMwGlobals( [ - 'wgExternalDiffEngine' => '/dev/null', - ] ); - $oldText = "aaa\nbbb\nccc"; $newText = "aaa\nxxx\nccc"; $expectedDiff = " aaa aaa\n-bbb+xxx\n ccc ccc"; @@ -203,12 +193,6 @@ class DifferenceEngineTest extends MediaWikiTestCase { } public function testSetContent() { - // Set $wgExternalDiffEngine to something bogus to try to force use of - // the PHP engine rather than wikidiff2. - $this->setMwGlobals( [ - 'wgExternalDiffEngine' => '/dev/null', - ] ); - $oldContent = ContentHandler::makeContent( 'xxx', null, CONTENT_MODEL_TEXT ); $newContent = ContentHandler::makeContent( 'yyy', null, CONTENT_MODEL_TEXT ); @@ -243,12 +227,6 @@ class DifferenceEngineTest extends MediaWikiTestCase { public function testGetDiffBody( RevisionRecord $oldRevision = null, RevisionRecord $newRevision = null, $expectedDiff ) { - // Set $wgExternalDiffEngine to something bogus to try to force use of - // the PHP engine rather than wikidiff2. - $this->setMwGlobals( [ - 'wgExternalDiffEngine' => '/dev/null', - ] ); - if ( $expectedDiff instanceof Exception ) { $this->setExpectedException( get_class( $expectedDiff ), $expectedDiff->getMessage() ); }