skip test for WikitextContentHandler::merge3 if $wgDiff3 isn't configured
[lhc/web/wiklou.git] / tests / phpunit / includes / WikitextContentHandlerTest.php
index a493aac..a7615cf 100644 (file)
@@ -104,6 +104,18 @@ class WikitextContentHandlerTest extends MediaWikiTestCase {
         * @dataProvider dataMerge3
         */
        public function testMerge3( $old, $mine, $yours, $expected ) {
+               global $wgDiff3;
+
+               if ( !$wgDiff3 ) {
+                       $this->markTestSkipped( "Can't test merge3(), since \$wgDiff3 is not configured" );
+               }
+
+               if ( !file_exists( $wgDiff3 ) ) {
+                       #XXX: this sucks, since it uses arcane internal knowledge about TextContentHandler::merge3 and wfMerge.
+                       $this->markTestSkipped( "Can't test merge3(), since \$wgDiff3 is misconfigured: can't find $wgDiff3" );
+               }
+
+               // test merge
                $oldContent = new WikitextContent( $old );
                $myContent = new WikitextContent( $mine );
                $yourContent = new WikitextContent( $yours );