Fix parserTests.php script
authorArlo Breault <abreault@wikimedia.org>
Fri, 4 Mar 2016 00:52:39 +0000 (16:52 -0800)
committerArlo Breault <abreault@wikimedia.org>
Fri, 4 Mar 2016 00:52:39 +0000 (16:52 -0800)
 * Follow up to 60e4f3fd

Change-Id: If1370a720da21c3662fda4100c96b1758ddc1dc0

includes/context/RequestContext.php
tests/parserTests.php

index 63b4f71..35ee1b7 100644 (file)
@@ -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;
index 7e6f68c..b3cb89a 100644 (file)
@@ -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' ];