From c0f8b4207ff25d23cbb4216273878c64f82bbf20 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 9 Jul 2020 10:07:44 +0200 Subject: [PATCH 1/3] cs fix --- bin/simple-phpunit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/simple-phpunit b/bin/simple-phpunit index 90efc976..27ea6037 100755 --- a/bin/simple-phpunit +++ b/bin/simple-phpunit @@ -117,7 +117,7 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__ 'requires' => array('php' => '*'), ); - if (1 === \count($info['versions'])) { + if (1 === count($info['versions'])) { $passthruOrFail("$COMPOSER create-project --ignore-platform-reqs --no-install --prefer-dist --no-scripts --no-plugins --no-progress -s dev phpunit/phpunit phpunit-$PHPUNIT_VERSION \"$PHPUNIT_VERSION.*\""); } else { $passthruOrFail("$COMPOSER create-project --ignore-platform-reqs --no-install --prefer-dist --no-scripts --no-plugins --no-progress phpunit/phpunit phpunit-$PHPUNIT_VERSION \"$PHPUNIT_VERSION.*\""); From 03f831108f7cea087be83cc6dd07d3419542a5ba Mon Sep 17 00:00:00 2001 From: Colin O'Dell Date: Sun, 19 Jul 2020 09:57:33 -0400 Subject: [PATCH 2/3] Fix checks for phpunit releases on Composer 2 (resolves #37601) --- bin/simple-phpunit | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/simple-phpunit b/bin/simple-phpunit index 27ea6037..7b5e3b16 100755 --- a/bin/simple-phpunit +++ b/bin/simple-phpunit @@ -117,7 +117,11 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__ 'requires' => array('php' => '*'), ); - if (1 === count($info['versions'])) { + $stableVersions = array_filter($info['versions'], function($v) { + return !preg_match('/-dev$|^dev-/', $v); + }); + + if (!$stableVersions) { $passthruOrFail("$COMPOSER create-project --ignore-platform-reqs --no-install --prefer-dist --no-scripts --no-plugins --no-progress -s dev phpunit/phpunit phpunit-$PHPUNIT_VERSION \"$PHPUNIT_VERSION.*\""); } else { $passthruOrFail("$COMPOSER create-project --ignore-platform-reqs --no-install --prefer-dist --no-scripts --no-plugins --no-progress phpunit/phpunit phpunit-$PHPUNIT_VERSION \"$PHPUNIT_VERSION.*\""); From fd0e80b29def90504e164aa0ed32402fabce1e60 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Thu, 16 Jul 2020 14:02:01 +0100 Subject: [PATCH 3/3] Require PHPUnit 9.3 on PHP 8 --- bin/simple-phpunit.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/simple-phpunit.php b/bin/simple-phpunit.php index 7c1c3123..7a1f011d 100644 --- a/bin/simple-phpunit.php +++ b/bin/simple-phpunit.php @@ -93,7 +93,10 @@ } }; -if (PHP_VERSION_ID >= 70200) { +if (PHP_VERSION_ID >= 80000) { + // PHP 8 requires PHPUnit 9.3+ + $PHPUNIT_VERSION = $getEnvVar('SYMFONY_PHPUNIT_VERSION', '9.3'); +} elseif (PHP_VERSION_ID >= 70200) { // PHPUnit 8 requires PHP 7.2+ $PHPUNIT_VERSION = $getEnvVar('SYMFONY_PHPUNIT_VERSION', '8.3'); } elseif (PHP_VERSION_ID >= 70100) {