aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/phpunit.php
diff options
context:
space:
mode:
authorDaimona Eaytoy <daimona.wiki@gmail.com>2023-07-02 19:14:27 +0200
committerKrinkle <krinkle@fastmail.com>2023-07-12 19:28:39 +0000
commitd2a30096f142a582ede952c28d2edd83e5bf1598 (patch)
treeb602172c1e4197f907e064c17edcc121460ef088 /tests/phpunit/phpunit.php
parent8bd59ff17ee78952a0c9b2ad1746babde0743842 (diff)
downloadmediawikicore-d2a30096f142a582ede952c28d2edd83e5bf1598.tar.gz
mediawikicore-d2a30096f142a582ede952c28d2edd83e5bf1598.zip
phpunit: Deprecate tests/phpunit/phpunit.php script
`composer phpunit:entrypoint` should be used instead. Copy all the setup to a new bootstrap file, with some adjustments for the bootstrap not being in the global scope when PHPUnit loads it. Leave the old script and bootstrap in place (e.g., for CI), but make them print deprecation warnings. Update the composer scripts to use the standard `phpunit` entrypoint. The bootstrap code was copied almost verbatim from the phpunit.php entrypoint to minimize changes. Any improvements can be done in other patches. Bug: T90875 Change-Id: I95a80c44f8d88c3c498efe1ae64008f0ff1eea55
Diffstat (limited to 'tests/phpunit/phpunit.php')
-rw-r--r--tests/phpunit/phpunit.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php
index e26c280a16f2..52f27e825479 100644
--- a/tests/phpunit/phpunit.php
+++ b/tests/phpunit/phpunit.php
@@ -98,10 +98,21 @@ class PHPUnitMaintClass {
// or when T227900 is resolved.
$args[] = '--configuration=' . __DIR__ . '/suite.xml';
}
+ $args[] = '--bootstrap=' . __DIR__ . '/bootstrap.maintenance.php';
$command->run( $args, true );
}
}
+$deprecationMsg = <<<EOT
+*******************************************************************************
+DEPRECATED: The tests/phpunit/phpunit.php entry point has been deprecated. Use
+ `composer phpunit:entrypoint` instead.
+*******************************************************************************
+
+EOT;
+
+fwrite( STDERR, $deprecationMsg );
+
if ( defined( 'MEDIAWIKI' ) ) {
exit( 'Wrong entry point?' );
}