Problem/Motivation

Drupal 11.4 deprecates check_markup(), and it will be removed in Drupal 12, per https://www.drupal.org/node/3588040 . This module uses check_markup() in a Trait in its testing suite. For convenience, Drupal provides the \Drupal\Tests\filter\Traits\ProcessedTextTestTrait trait with a helper method, facilitating testing.

We should update the test logic to make use of the new helper method, while supporting versions of Drupal core prior to 11.4 by using the deprecated check_markup() method. Although Drupal core provided a new DeprecationHelper method to facilitate this kind of thing, that was introduced in Drupal 10.1, and since this module's 2.0.x branch currently declares compatibility with Drupal 9, we should use the "old" way of checking Drupal versions (e.g., if (version_compare(\Drupal::VERSION, '9.4', '>=')) {).

Proposed resolution

Add the ProcessedTextTestTrait to the Pathologic Test Trait and add version compare logic to use either check_markup or $this->processText

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Issue fork pathologic-3612876

Command icon 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

mark_fullmer created an issue. See original summary.

mark_fullmer’s picture

Issue summary: View changes

mark_fullmer’s picture

Status: Active » Fixed

I tested this in the context of Drupal < 11.4, 11.4, and 12 and test execution works in all those contexts. As such, I'm proceeding to merge this into the 2.0.x branch; this will not affect the Drupal core compatibility state of that branch.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.