From 09be5db2b3c0c0a044bd612a89459662f680678d Mon Sep 17 00:00:00 2001 From: Arlo Breault Date: Thu, 3 Mar 2016 16:52:39 -0800 Subject: [PATCH] Fix parserTests.php script * Follow up to 60e4f3fd Change-Id: If1370a720da21c3662fda4100c96b1758ddc1dc0 --- includes/context/RequestContext.php | 2 +- tests/parserTests.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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' ]; -- 2.20.1