Remove 8.7.x fallback code for TaxonomyTestTrait

Created on 7 November 2019, over 5 years ago
Updated 6 May 2025, 4 days ago

Problem/Motivation

#3041030: Convert functional EfqTest to a kernel test and move TaxonomyTestTrait from tests/src/Functional to tests/src/Traits β†’ moved the test trait we use to create vocabularies and terms in tests/src/Functional/ArgumentValidatorTest.php
This is throwing deprecation errors when trying to port this module to work with D9.
In Slack, @larowlan and I came up with a solution that lets our tests still work on 8.7.x and not throw errors on modern branches.
But it's ugly:

https://www.drupal.org/node/3041703 β†’

use Drupal\Tests\taxonomy\Traits\TaxonomyTestTrait;
if (!trait_exists('\Drupal\Tests\taxonomy\Traits\TaxonomyTestTrait')) {
  class_alias('\Drupal\Tests\taxonomy\Functional\TaxonomyTestTrait', '\Drupal\Tests\taxonomy\Traits\TaxonomyTestTrait');
}

We should rip it out when 8.7.x is EOL.

Proposed resolution

Remove the complicated hoops we have to jump through to let our tests pass on all branches we care about.

Remaining tasks

  1. Wait for 8.7.x to be dropped.
  2. Rip out the code.

User interface changes

-

API changes

-

Data model changes

-

Release notes snippet

-

πŸ“Œ Task
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States dww

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024