[PP-1] Add @group legacy to non-TestCase-extending code calling deprecated things

Created on 25 August 2023, almost 2 years ago

Problem/Motivation

As (soon to be) discovered by mglaman/phpstan-drupal 1.2.0 (see ๐Ÿ“Œ Bump mglaman/phpstan-drupal to latest to make daily "updated deps" QA run pass again Fixed ), we are using some deprecated functionality throughout Drupal core.

This issue is for dealing with code calling deprecated "things" in classes that don't extend \PHPUnit\Framework\TestCase.

Until now this code wasn't throwing any deprecation warnings, but when ๐Ÿ“Œ Bump mglaman/phpstan-drupal to latest to make daily "updated deps" QA run pass again Fixed lands, they will.

So far, this issue has identified and tries to fix the following PHPStan failures:

 ------ ------------------------------------------------------------------ 
  Line   core/modules/field/tests/src/Kernel/FieldAttachStorageTest.php    
 ------ ------------------------------------------------------------------ 
  66     Call to deprecated method loadRevision() of class                 
         Drupal\Core\Entity\EntityStorageInterface:                        
         in drupal:10.1.0 and is removed from drupal:11.0.0. Use           
         \Drupal\Core\Entity\RevisionableStorageInterface::loadRevision    
         instead.                                                          
  260    Call to deprecated method loadRevision() of class                 
         Drupal\Core\Entity\EntityStorageInterface:                        
         in drupal:10.1.0 and is removed from drupal:11.0.0. Use           
         \Drupal\Core\Entity\RevisionableStorageInterface::loadRevision    
         instead.                                                          
  265    Call to deprecated method deleteRevision() of class               
         Drupal\Core\Entity\EntityStorageInterface:                        
         in drupal:10.1.0 and is removed from drupal:11.0.0. Use           
         \Drupal\Core\Entity\RevisionableStorageInterface::deleteRevision  
         instead.                                                          
  269    Call to deprecated method loadRevision() of class                 
         Drupal\Core\Entity\EntityStorageInterface:                        
         in drupal:10.1.0 and is removed from drupal:11.0.0. Use           
         \Drupal\Core\Entity\RevisionableStorageInterface::loadRevision    
         instead.                                                          
  282    Call to deprecated method loadRevision() of class                 
         Drupal\Core\Entity\EntityStorageInterface:                        
         in drupal:10.1.0 and is removed from drupal:11.0.0. Use           
         \Drupal\Core\Entity\RevisionableStorageInterface::loadRevision    
         instead.                                                          
 ------ ------------------------------------------------------------------ 

Note: Depending on the landing of ๐Ÿ“Œ Bump mglaman/phpstan-drupal to latest to make daily "updated deps" QA run pass again Fixed before the landing of this issue, we also might need to remove a suppression from core/phpstan-baseline.neon

Steps to reproduce

Proposed resolution

Add @group legacy to EditorMediaDialogTest, which seems we have missed in ๐Ÿ“Œ Deprecate EditorLinkDialog, EditorImageDialog and EditorMediaDialog in Drupal 10.1 for removal in Drupal 11 Fixed .

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

๐Ÿ“Œ Task
Status

Postponed

Version

11.0 ๐Ÿ”ฅ

Component
PHPUnitย  โ†’

Last updated about 2 hours ago

Created by

๐Ÿ‡ณ๐Ÿ‡ฑNetherlands spokje

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024