From ecf528e5525ffc19c4298cd1431fc8c435412531 Mon Sep 17 00:00:00 2001 From: daniel Date: Mon, 14 Feb 2022 09:51:18 +0100 Subject: [PATCH] Fix duplicate define() in bootstrap.php wfDetectLocalSettingsFile already defines MW_CONFIG_FILE, defining it again in bootstrap.php triggers a warning. Bug: T301503 Change-Id: I0f2892dd803e4d7be0e3e8c8bca26b1251bc6f14 --- tests/phpunit/bootstrap.php | 2 +- tests/phpunit/phpunit.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/bootstrap.php b/tests/phpunit/bootstrap.php index 2f874f12116..3819662a5b1 100644 --- a/tests/phpunit/bootstrap.php +++ b/tests/phpunit/bootstrap.php @@ -53,7 +53,7 @@ define( 'MW_ENTRY_POINT', 'cli' ); $IP = realpath( __DIR__ . '/../../' ); // We don't use a settings file here but some code still assumes that one exists wfRequireOnceInGlobalScope( "$IP/includes/BootstrapHelperFunctions.php" ); -define( 'MW_CONFIG_FILE', wfDetectLocalSettingsFile( $IP ) ); +wfDetectLocalSettingsFile( $IP ); // these variables must be defined before setup runs $GLOBALS['IP'] = $IP; diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index 6f79eb8f884..f643767795a 100755 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -183,9 +183,7 @@ require_once "$IP/includes/BootstrapHelperFunctions.php"; $wrapper = new PHPUnitMaintClass(); $wrapper->setup(); - -// Define how settings are loaded (e.g. LocalSettings.php) -define( 'MW_CONFIG_FILE', $wrapper->loadSettings() ); +$wrapper->loadSettings(); function wfPHPUnitSetup() { // phpcs:ignore MediaWiki.NamingConventions.ValidGlobalName.allowedPrefix