Skip to content

Commit

Permalink
allow bin/phpunit to work with phpunit 10
Browse files Browse the repository at this point in the history
  • Loading branch information
jrushlow committed Feb 6, 2023
1 parent 03b3867 commit 0a604cd
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions symfony/phpunit-bridge/5.3/bin/phpunit
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ if (!ini_get('date.timezone')) {
}

if (is_file(dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit')) {
define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php');
require PHPUNIT_COMPOSER_INSTALL;
PHPUnit\TextUI\Command::main();
if (class_exists(PHPUnit\TextUI\Command::class)) {
// PHPUnit < 9.x
define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php');
require PHPUNIT_COMPOSER_INSTALL;
PHPUnit\TextUI\Command::main();
} else {
// PHPUnit >= 10.0
require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit';
}
} else {
if (!is_file(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
Expand Down

0 comments on commit 0a604cd

Please sign in to comment.