Problem/Motivation

Running the test suite on recent Drupal 11 minors triggers two deprecations:

  • Since drupal:11.3.0, Functional and FunctionalJavascript test classes must specify the #[RunTestsInSeparateProcesses] attribute. This throws an exception in drupal:12.0.0 (change record). No Commerce test class has it yet.
  • ConfigEntityBase::trustData() is deprecated in drupal:11.4.0 with no replacement, which makes PHPStan fail. It is only called in PaymentMethodTest::testUserAccess().

These are currently hidden in CI by --suppress-deprecations.

Proposed resolution

  • Add #[RunTestsInSeparateProcesses] to every concrete Functional and FunctionalJavascript test class.
  • Replace $role->trustData()->save() with $role->save() in PaymentMethodTest.

Both changes are safe on Drupal 10.3: PHPUnit 9 ignores the attribute, and the role saved in the test is valid config.

Once committed, this will be cherry-picked to 4.x as part of #3638820: Fix Drupal 12 deprecations.

Remaining tasks

  • Update the test classes.
  • Confirm the pipeline is green.

User interface changes

None.

API changes

None. Test-only changes.

Data model changes

None.

Issue fork commerce-3638834

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

jsacksick created an issue. See original summary.

  • jsacksick committed 49f36cd1 on 3.x
    test: #3638834 Add #[RunTestsInSeparateProcesses] to Kernel and...
jsacksick’s picture

Status: Active » Fixed

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.

  • jsacksick committed 49f36cd1 on 4.x
    test: #3638834 Add #[RunTestsInSeparateProcesses] to Kernel and...