phpunit: Check for MW_PHPUNIT_TEST constant

$wgWikimediaJenkinsCI may not be enabled in LocalSettings.php.

tests/phpunit/phpunit.php reads this global, but vendor/bin/phpunit does
not.

Bug: T90875
Change-Id: I91628f0e63d4f67d1d3060cca3a17b95e0faf826
This commit is contained in:
Kosta Harlan 2022-07-12 18:30:09 +02:00
parent bb500cc638
commit aca8deafb1
No known key found for this signature in database
GPG key ID: BC3D8915606A5ED9

View file

@ -152,7 +152,7 @@ class ConfirmEditHooks implements
global $wgCaptchaTriggers, $wgWikimediaJenkinsCI;
// There is no need to run (core) tests with enabled ConfirmEdit - bug T44145
if ( isset( $wgWikimediaJenkinsCI ) && $wgWikimediaJenkinsCI === true ) {
if ( defined( 'MW_PHPUNIT_TEST' ) || ( isset( $wgWikimediaJenkinsCI ) && $wgWikimediaJenkinsCI === true ) ) {
$wgCaptchaTriggers = array_fill_keys( array_keys( $wgCaptchaTriggers ), false );
}
}