From 51941a42ece6d7e8cbcf34f92722133b20f09f06 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Tue, 4 Jul 2023 09:36:15 +1000 Subject: [PATCH] Disable remote loading during PHPUnit tests Bug: T65015 Change-Id: I205c5e247f314f734178f6c745eaa507f736083a --- includes/BaseBlacklist.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/BaseBlacklist.php b/includes/BaseBlacklist.php index c0db0b8c..fb3f7249 100644 --- a/includes/BaseBlacklist.php +++ b/includes/BaseBlacklist.php @@ -299,6 +299,11 @@ abstract class BaseBlacklist { return []; } + if ( defined( 'MW_PHPUNIT_TEST' ) ) { + wfDebugLog( 'SpamBlacklist', 'remote loading disabled during PHPUnit test' ); + return []; + } + $miss = false; $cache = MediaWikiServices::getInstance()->getMainWANObjectCache(); $regexes = $cache->getWithSetCallback(