Whenever I try to run PHPUnit tests with a PHP version less than 8, I get an error like this:
Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.28. PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.28. in /var/www/html/w/vendor/composer/platform_check.php on line 24 PHP Stack trace: PHP 1. {main}() /var/www/html/w/vendor/bin/phpunit:0 PHP 2. include() /var/www/html/w/vendor/bin/phpunit:115 PHP 3. require() phpvfscomposer:///var/www/html/w/vendor/phpunit/phpunit/phpunit:95 PHP 4. ComposerAutoloaderInitf73e0b5361229c8c90eee54c77b9cd00::getLoader() /var/www/html/w/vendor/autoload.php:7 PHP 5. require() /var/www/html/w/vendor/composer/autoload_real.php:25 PHP 6. trigger_error($message = 'Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.28.', $error_type = 256) /var/www/html/w/vendor/composer/platform_check.php:24
This wouldn't be the end of the world, except when I try to generate a code coverage report, I get:
Error: This version of PHPUnit does not support code coverage on PHP 8
I tried grepping in vendor for >=.*8\.0\.2, and found that symfony/string, symfont/deprecation-contracts, and symfony/var-dumper all seem to have this requirement. I have no idea how Composer works, so I don't really know how to debug further.