From: Kosta Harlan Date: Wed, 14 Aug 2019 08:25:01 +0000 (+0200) Subject: Tests: Allow vendor/bin/phpunit from within extension directory X-Git-Tag: 1.34.0-rc.0~723^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/Boston?a=commitdiff_plain;h=ed92fc2103e3921ed138190ef794a422917f1a2a;p=lhc%2Fweb%2Fwiklou.git Tests: Allow vendor/bin/phpunit from within extension directory Prior to this patch, one could not run this command from within an extension directory: `../../vendor/bin/phpunit -c ../../phpunit.xml.dist tests/phpunit`, because our code in bootstrap.php loaded "LocalSettings.php" instead of $IP/LocalSettings.php. Note that making this change does not result in loading LocalSettings.php when running unit tests. Bug: T87781 Change-Id: Iee8440f11a2bb255567646289a1986d636c12765 --- diff --git a/tests/phpunit/bootstrap.php b/tests/phpunit/bootstrap.php index 4400475bee..f227ae1626 100644 --- a/tests/phpunit/bootstrap.php +++ b/tests/phpunit/bootstrap.php @@ -49,10 +49,9 @@ function wfRequireOnceInGlobalScope( $fileName ) { define( 'MEDIAWIKI', true ); define( 'MW_PHPUNIT_TEST', true ); -// We don't use a settings file here but some code still assumes that one exists -define( 'MW_CONFIG_FILE', 'LocalSettings.php' ); - $IP = realpath( __DIR__ . '/../../' ); +// We don't use a settings file here but some code still assumes that one exists +define( 'MW_CONFIG_FILE', "$IP/LocalSettings.php" ); // these variables must be defined before setup runs $GLOBALS['IP'] = $IP;