Skip to content

Commit 6f47092

Browse files
authored
Fix bin/phpunit for PHPUnit 10 (#1249)
1 parent 11095f4 commit 6f47092

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

symfony/phpunit-bridge/5.3/bin/phpunit

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ 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 (PHP_VERSION_ID >= 80000) {
10+
require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit';
11+
} else {
12+
define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php');
13+
require PHPUNIT_COMPOSER_INSTALL;
14+
PHPUnit\TextUI\Command::main();
15+
}
1216
} else {
1317
if (!is_file(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
1418
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";

symfony/phpunit-bridge/6.3/bin/phpunit

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ 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 (PHP_VERSION_ID >= 80000) {
10+
require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit';
11+
} else {
12+
define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php');
13+
require PHPUNIT_COMPOSER_INSTALL;
14+
PHPUnit\TextUI\Command::main();
15+
}
1216
} else {
1317
if (!is_file(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
1418
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";

0 commit comments

Comments
 (0)