From 68dbd2a42f5e7025f107fb7252afdf1e26e1dfd5 Mon Sep 17 00:00:00 2001 From: Arlo Breault Date: Fri, 1 Nov 2024 12:10:12 -0400 Subject: Fix running parserTests via the maintenance script Follows-Up: I3847870561a260597ad7a4e7fae01a616c2cd1c1 Change-Id: I089e6c4607613d35441bb712a9d6aae302f393b2 --- includes/context/RequestContext.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'includes/context/RequestContext.php') 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; -- cgit v1.2.3