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

CommentFileSizeAuthor
#2 3054674_2.patch3.67 KBmile23

Comments

Mile23 created an issue. See original summary.

mile23’s picture

Status: Active » Needs review
StatusFileSize
new3.67 KB

A patch.

berdir’s picture

Same 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

mile23’s picture

#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?

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

larowlan’s picture

Status: Needs review » Postponed (maintainer needs more info)
Issue tags: +Bug Smash Initiative

Is this still an issue or are those constants now gone

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

DRUPAL_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.