diff options
author | Arlo Breault <abreault@wikimedia.org> | 2024-11-01 12:10:12 -0400 |
---|---|---|
committer | Arlo Breault <abreault@wikimedia.org> | 2024-11-01 13:34:03 -0400 |
commit | 68dbd2a42f5e7025f107fb7252afdf1e26e1dfd5 (patch) | |
tree | 6dc5b042adad321ee14360659e2436e86b2f80b1 | |
parent | 08045dd3fba6f82503eb43fd8211122e2a4c6838 (diff) | |
download | mediawikicore-68dbd2a42f5e7025f107fb7252afdf1e26e1dfd5.tar.gz mediawikicore-68dbd2a42f5e7025f107fb7252afdf1e26e1dfd5.zip |
Fix running parserTests via the maintenance script
Follows-Up: I3847870561a260597ad7a4e7fae01a616c2cd1c1
Change-Id: I089e6c4607613d35441bb712a9d6aae302f393b2
-rw-r--r-- | includes/context/RequestContext.php | 2 | ||||
-rw-r--r-- | tests/parser/parserTests.php | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/includes/context/RequestContext.php b/includes/context/RequestContext.php index 35fd5adb2d8c..ac1a1b48501b 100644 --- a/includes/context/RequestContext.php +++ b/includes/context/RequestContext.php @@ -388,7 +388,7 @@ class RequestContext implements IContextSource, MutableContext { } public function hasUser(): bool { - if ( !defined( 'MW_PHPUNIT_TEST' ) ) { + if ( !defined( 'MW_PHPUNIT_TEST' ) && !defined( 'MW_PARSER_TEST' ) ) { throw new LogicException( __METHOD__ . '() should be called only from tests!' ); } return $this->user !== null; diff --git a/tests/parser/parserTests.php b/tests/parser/parserTests.php index 454cc72de0a6..4d1a72a05ed2 100644 --- a/tests/parser/parserTests.php +++ b/tests/parser/parserTests.php @@ -35,6 +35,7 @@ use MediaWiki\Tests\DummyTermColorer; use Wikimedia\Parsoid\Utils\ScriptUtils; define( 'MW_AUTOLOAD_TEST_CLASSES', true ); +define( 'MW_PARSER_TEST', true ); class ParserTestsMaintenance extends Maintenance { |