From: Arlo Breault Date: Fri, 4 Mar 2016 00:52:39 +0000 (-0800) Subject: Fix parserTests.php script X-Git-Tag: 1.31.0-rc.0~7740 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=09be5db2b3c0c0a044bd612a89459662f680678d;p=lhc%2Fweb%2Fwiklou.git Fix parserTests.php script * Follow up to 60e4f3fd Change-Id: If1370a720da21c3662fda4100c96b1758ddc1dc0 --- diff --git a/includes/context/RequestContext.php b/includes/context/RequestContext.php index 63b4f710c7..35ee1b7ec4 100644 --- a/includes/context/RequestContext.php +++ b/includes/context/RequestContext.php @@ -496,7 +496,7 @@ class RequestContext implements IContextSource, MutableContext { * Resets singleton returned by getMain(). Should be called only from unit tests. */ public static function resetMain() { - if ( !defined( 'MW_PHPUNIT_TEST' ) ) { + if ( !( defined( 'MW_PHPUNIT_TEST' ) || defined( 'MW_PARSER_TEST' ) ) ) { throw new MWException( __METHOD__ . '() should be called only from unit tests!' ); } self::$instance = null; diff --git a/tests/parserTests.php b/tests/parserTests.php index 7e6f68c281..b3cb89ae02 100644 --- a/tests/parserTests.php +++ b/tests/parserTests.php @@ -24,6 +24,8 @@ * @ingroup Testing */ +define( 'MW_PARSER_TEST', true ); + $options = [ 'quick', 'color', 'quiet', 'help', 'show-output', 'record', 'run-disabled', 'run-parsoid' ]; $optionsWithArgs = [ 'regex', 'filter', 'seed', 'setversion', 'file' ];