Problem/Motivation
#3573954: Move common code across Drupal base test suite classes to DrupalTestCaseTrait and #3589047: Deprecate TestRequirementsTrait::getDrupalRoot() made some good improvements to the base test classes and trait. They did so with a property hook which meant the changes weren't backported. This complicates ongoing work that touches on DrupalKernel's application root since it can no longer happen across versions.
#3590425: Remove usage of property hook for DrupalTestCaseTrait::$root removed the hook property to allow backporting to 11.x
Steps to reproduce
Proposed resolution
Cherry-pick the following commits to 11.x individually or squash them in one:
- #3573954: Move common code across Drupal base test suite classes to DrupalTestCaseTrait - fe682bee7a23d2fa0d61aeb4f9525c8136e9ec1b
- #3589047: Deprecate TestRequirementsTrait::getDrupalRoot() - 0673bf3e4be11ead5eef1614e7d94fb21a919bfb
- #3590425: Remove usage of property hook for DrupalTestCaseTrait::$root
Additionally make the following changes:
- Update the deprecation messages in
TestRequirementsTrait,DrupalTestCaseTrait::getDrupalRoot, andBrowserTestBase::setUpAppRootto indicate the new "in" version - Update the associated change record #3574112: TestRequirementsTrait is deprecated to indicate the new "introduced in" branch and version
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3590435
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
kingdutchComment #5
kingdutchCreated one MR for 11.x which includes the backported changes, created another MR for main which includes the updates to the deprecations.
Comment #6
kingdutch#3590425: Remove usage of property hook for DrupalTestCaseTrait::$root was merged
Comment #7
mondrakeMR !15782 is 11.x only and includes backport of #3573954: Move common code across Drupal base test suite classes to DrupalTestCaseTrait , #3589047: Deprecate TestRequirementsTrait::getDrupalRoot() and #3590425: Remove usage of property hook for DrupalTestCaseTrait::$root .
MR !15783 in main only and updates deprecation version to 11.4 instead of 12.
+1 to RTBC, but I wont set it as I worked on quite some of the earlier issues.
Comment #8
mondrakeComment #9
smustgrave commentedHow come the separate issue vs marking those issues to be backported? Just curious
Comment #10
kingdutchPrimarily, me trying to navigate the Drupal core process and not breaking things because we only change one of the things, while being a few rabbit holes away from the issue I'm actually trying to fix :)
So making a single issue was the easiest way for me to ensure the changes all get backported and we don't get rifts between 12.x and 11.x because one issue is backported and another is not.
I've kept things as individual commits in the MR, so if rebase instead of squash is used then you still have the original papertrail. In theory we can also move those back to the individual issues; then we need to coordinate the order between those 3.
Comment #11
mondrakeThe first one, #3573954: Move common code across Drupal base test suite classes to DrupalTestCaseTrait , as clearly commented in the issue, cannot be backportd as such. It uses a PHP 8.4 language feature (property hook), and Drupal 11 still supports PHP 8.3. If it were backported, the repo would be broken between that commit and the commit of the third backport. Since there is no guarantee that the 3 backports would be committed together before push, a single commit is the safest way.
Comment #12
alexpottCommitted and pushed d43dcd724b3 to main. Thanks!
Committed and pushed e93d83aef99 to 11.x. Thanks!
Comment #16
alexpottI updated the CR.