Add @group legacy to non-TestCase-extending code for testing calling deprecated things

Created on 25 August 2023, over 1 year ago
Updated 30 January 2024, 11 months ago

Problem/Motivation

As 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 used for testing that don't extend \PHPUnit\Framework\TestCase.

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

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

 ------ -------------------------------------------------------------------------------------------------------------------------------------------------------------
  Line   ExternalCommandRequirementTest.php
 ------ -------------------------------------------------------------------------------------------------------------------------------------------------------------
  136    Usage of deprecated trait Drupal\BuildTests\Framework\ExternalCommandRequirementsTrait in class Drupal\BuildTests\Framework\Tests\UsesCommandRequirements:
         in drupal:10.2.0 and is removed from drupal:11.0.0. Use
         Drupal\\TestTools\\Extension\\RequiresComposerTrait instead.
  149    Usage of deprecated trait Drupal\BuildTests\Framework\ExternalCommandRequirementsTrait in class Drupal\BuildTests\Framework\Tests\ClassRequiresAvailable:
         in drupal:10.2.0 and is removed from drupal:11.0.0. Use
         Drupal\\TestTools\\Extension\\RequiresComposerTrait instead.
  162    Usage of deprecated trait Drupal\BuildTests\Framework\ExternalCommandRequirementsTrait in class Drupal\BuildTests\Framework\Tests\ClassRequiresUnavailable:
         in drupal:10.2.0 and is removed from drupal:11.0.0. Use
         Drupal\\TestTools\\Extension\\RequiresComposerTrait instead.
  168    Usage of deprecated trait Drupal\BuildTests\Framework\ExternalCommandRequirementsTrait in class Drupal\BuildTests\Framework\Tests\MethodRequires:
         in drupal:10.2.0 and is removed from drupal:11.0.0. Use
         Drupal\\TestTools\\Extension\\RequiresComposerTrait instead.
 ------ -------------------------------------------------------------------------------------------------------------------------------------------------------------
 ------ --------------------------------------------------------------------------------- 
  Line   core/modules/system/tests/modules/deprecation_test/src/DeprecatedController.php  
 ------ --------------------------------------------------------------------------------- 
  18     Call to deprecated function deprecation_test_function():                         
         in drupal:8.4.0 and is removed from drupal:9.0.0. This is                        
           the deprecation message for deprecated_test_function().                        
 ------ --------------------------------------------------------------------------------- 

Steps to reproduce

Proposed resolution

Add @group legacy to the code, which makes mglaman/phpstan-drupal aware this is using deprecated code and won't emit a deprecation warning.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

๐Ÿ“Œ Task
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
PHPUnitย  โ†’

Last updated about 15 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