Problem/Motivation
After we apply the fix from #3054649: DrupalKernelTest results in ERROR HANDLER CHANGED! and then run unit tests from PHPUnit we see this:
$ ./vendor/bin/phpunit -c core/ --testsuite unit --stop-on-error
[..]
There was 1 error:
1) Drupal\Tests\Core\ClassLoader\ClassLoaderTest::testDrupalClassloadeRegisterDeprecation
Constant DRUPAL_MINIMUM_PHP already defined
However, that class loader test does not directly use DRUPAL_MINIMUM_PHP.
Only two unit tests muck about with defining DRUPAL_MINIMUM_PHP, and they are Drupal\Tests\Core\Extension\ThemeHandlerTest and Drupal\Tests\Core\Extension\ThemeExtensionListTest.
Since they define the constant outside of isolation, the constant leaks over into ClassLoaderTest.
Proposed resolution
Isolate these tests' use of DRUPAL_MINIMUM_PHP and spread joy and happiness to all the other tests which can prosper in their own isolated environment.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comments
Comment #2
mile23A patch.
Comment #3
berdirSame story here, we're in the process of deprecating/removing those constants, that would be a cleaner way forward. And this conflicts with #3053363: Remove support for PHP 5 in Drupal 8.8
Comment #4
mile23#3053363: Remove support for PHP 5 in Drupal 8.8 is in, and the patch still applies, so apparently it doesn't conflict.
#2908079: Move some of the bootstrap.inc PHP-related constants to \Drupal and deprecate the old versions is an issue that addresses
ThemeHandlerTest, which I filed two years ago as a follow-up to #2843328: Enforce minimum PHP version in composer dependencies. Am I filled with hope that it will land first?Comment #10
larowlanIs this still an issue or are those constants now gone
Comment #13
quietone commentedDRUPAL_MINIMUM_PHP was removed in #3260778: Remove deprecated code from bootstrap.inc. It was replaced by MINIMUM_SUPPORTED_PHP which was removed in #3261447: Add an API for dynamically setting recommended and supported PHP versions based on known and predicted PHP release schedules. The version is now obtained via \Drupal\Core\Utility\PhpRequirements::getMinimumSupportedPhp.
I think it is safe to close this as outdated.