From 6f47092b8fbebe82b1e79f06e5edd9baa2c3fc8f Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Mon, 6 Nov 2023 12:18:22 +0100 Subject: [PATCH] Fix bin/phpunit for PHPUnit 10 (#1249) --- symfony/phpunit-bridge/5.3/bin/phpunit | 10 +++++++--- symfony/phpunit-bridge/6.3/bin/phpunit | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/symfony/phpunit-bridge/5.3/bin/phpunit b/symfony/phpunit-bridge/5.3/bin/phpunit index f26f2c72..692baccb 100755 --- a/symfony/phpunit-bridge/5.3/bin/phpunit +++ b/symfony/phpunit-bridge/5.3/bin/phpunit @@ -6,9 +6,13 @@ 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 (PHP_VERSION_ID >= 80000) { + require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit'; + } else { + define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php'); + require PHPUNIT_COMPOSER_INSTALL; + PHPUnit\TextUI\Command::main(); + } } 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"; diff --git a/symfony/phpunit-bridge/6.3/bin/phpunit b/symfony/phpunit-bridge/6.3/bin/phpunit index f26f2c72..692baccb 100755 --- a/symfony/phpunit-bridge/6.3/bin/phpunit +++ b/symfony/phpunit-bridge/6.3/bin/phpunit @@ -6,9 +6,13 @@ 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 (PHP_VERSION_ID >= 80000) { + require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit'; + } else { + define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php'); + require PHPUNIT_COMPOSER_INSTALL; + PHPUnit\TextUI\Command::main(); + } } 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";