From: Tim Starling Date: Wed, 28 Sep 2016 00:22:46 +0000 (+1000) Subject: parserTests: Do not check for DjVu support X-Git-Tag: 1.31.0-rc.0~5213^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=8fd5a3b79337b20049925b025ca866e9ef164317;p=lhc%2Fweb%2Fwiklou.git parserTests: Do not check for DjVu support Unnecessary now that we have MockMediaHandlerFactory. Have MockDjVuHandler::isEnabled() always return true so that we don't have to hack the configuration. May possibly help the ProofreadPage tests pass in Jenkins. Also remove a couple of unnecessary debug log calls. Change-Id: Ic8aea8fe235b4b5336a7377c4b61379ed06a67ab --- diff --git a/tests/parser/ParserTestRunner.php b/tests/parser/ParserTestRunner.php index 369cd0e8c8..374bd0e408 100644 --- a/tests/parser/ParserTestRunner.php +++ b/tests/parser/ParserTestRunner.php @@ -59,11 +59,6 @@ class ParserTestRunner { */ private $dbClone; - /** - * @var DjVuSupport - */ - private $djVuSupport; - /** * @var TidySupport */ @@ -138,7 +133,6 @@ class ParserTestRunner { $this->runDisabled = !empty( $options['run-disabled'] ); $this->runParsoid = !empty( $options['run-parsoid'] ); - $this->djVuSupport = new DjVuSupport(); $this->tidySupport = new TidySupport( !empty( $options['use-tidy-config'] ) ); if ( !$this->tidySupport->isEnabled() ) { $this->recorder->warning( @@ -456,7 +450,6 @@ class ParserTestRunner { } $this->setupDone[$funcName] = true; return function () use ( $funcName ) { - wfDebug( "markSetupDone unmarked $funcName" ); $this->setupDone[$funcName] = false; }; } @@ -752,14 +745,6 @@ class ParserTestRunner { $user = $context->getUser(); $options = ParserOptions::newFromContext( $context ); - if ( isset( $opts['djvu'] ) ) { - if ( !$this->djVuSupport->isEnabled() ) { - $this->recorder->skipped( $test, - 'djvu binaries do not exist or are not executable' ); - return false; - } - } - if ( isset( $opts['tidy'] ) ) { if ( !$this->tidySupport->isEnabled() ) { $this->recorder->skipped( $test, 'tidy extension is not installed' ); @@ -1028,7 +1013,6 @@ class ParserTestRunner { }; // Set content language. This invalidates the magic word cache and title services - wfDebug( "Setting up language $langCode" ); $lang = Language::factory( $langCode ); $setup['wgContLang'] = $lang; $reset = function () { diff --git a/tests/phpunit/mocks/media/MockDjVuHandler.php b/tests/phpunit/mocks/media/MockDjVuHandler.php index 018d978fc3..0e0b9435cd 100644 --- a/tests/phpunit/mocks/media/MockDjVuHandler.php +++ b/tests/phpunit/mocks/media/MockDjVuHandler.php @@ -22,6 +22,10 @@ */ class MockDjVuHandler extends DjVuHandler { + function isEnabled() { + return true; + } + function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) { if ( !$this->normaliseParams( $image, $params ) ) { return new TransformParameterError( $params );