Skip to content

Commit 0a604cd

Browse files
committed
allow bin/phpunit to work with phpunit 10
1 parent 03b3867 commit 0a604cd

File tree

1 file changed

+9
-3
lines changed
  • symfony/phpunit-bridge/5.3/bin

1 file changed

+9
-3
lines changed

symfony/phpunit-bridge/5.3/bin/phpunit

+9-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ if (!ini_get('date.timezone')) {
66
}
77

88
if (is_file(dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit')) {
9-
define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php');
10-
require PHPUNIT_COMPOSER_INSTALL;
11-
PHPUnit\TextUI\Command::main();
9+
if (class_exists(PHPUnit\TextUI\Command::class)) {
10+
// PHPUnit < 9.x
11+
define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php');
12+
require PHPUNIT_COMPOSER_INSTALL;
13+
PHPUnit\TextUI\Command::main();
14+
} else {
15+
// PHPUnit >= 10.0
16+
require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit';
17+
}
1218
} else {
1319
if (!is_file(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
1420
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";

0 commit comments

Comments
 (0)