Problem
The phpstan (next major) job reports 18 errors on 4.x. Every one is a call to something Drupal 11.5 deprecated, and every one is in test code. The job is allow_failure, so the pipeline badge stays green and the errors are visible only by opening the job.
The calls
- 15 calls to
user_role_grant_permissions(), deprecated in drupal:11.5.0 and removed from drupal:13.0.0. - 2 calls to
user_role_revoke_permissions(), same deprecation. - 1 call to
BrowserTestBase::xpath(), deprecated in drupal:11.5.0 and removed from drupal:13.0.0.
Where
In domain: DomainBlockVisibilityTest, DomainInactiveTest, DomainNavBlockTest, DomainNegotiatorTest, DomainPrefixFunctionalTest, DomainTokenTest and Views/ActiveDomainDefaultArgumentTest. In domain_alias: DomainAliasEnvironmentTest, DomainAliasNegotiatorTest and DomainAliasWildcardTest. In domain_config_language: DomainConfigHomepageTest.
Proposed resolution
The replacements the deprecation messages name are not available on every core 4.x supports, so the swap cannot be the literal one. RoleInterface::grantPermissions() and BrowserTestBase::getNodeElementsByXpath() both arrived with the deprecations in 11.5, while 4.x requires ^11.4 || ^12.
Use instead what has been available since well before 11.4: UserCreationTrait::grantPermissions() for the grants, which these tests already have through BrowserTestBase; RoleInterface::revokePermission() followed by a save for the revokes; and $this->getSession()->getPage()->findAll('xpath', ...) for the xpath call.
AI-Generated: Yes (Claude Code was used to help draft this issue summary. The deprecation list and the file list were read from the failing job on the 4.x head pipeline, and the availability of each proposed replacement was checked against core 11.3 and core 12 sources.)
Issue fork domain-3623222
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 #4
mably commented