Problem/Motivation

The approach to add a silenced deprecation in #3546029: Ensure that #[RunTestsInSeparateProcesses] attribute is added to all Kernel tests and #3550335: Ensure that #[RunTestsInSeparateProcesses] attribute is added to all Functional tests does not work if the test ignores deprecations.

Steps to reproduce

See \Drupal\Tests\system\Kernel\Theme\ThemeEngineTest

Proposed resolution

Add a PHPStan rule - can also ensure we have a group too which at least used to be necessary for run-tests to actually run the test.

Remaining tasks

User interface changes

None

Introduced terminology

N/a

API changes

None

Data model changes

None

Release notes snippet

N/a

Issue fork drupal-3556315

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

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
mondrake’s picture

Status: Needs review » Needs work

Good catch.

Few comments:
1) this is now partially overlapping with #3548982: Enforce removal of PHPUnit annotations from test classes' class metadata, in the sense that it analyses same scope with slightly different checks. May be better try to have one rule only?
2) the check on #[Group] attribute presence here is limited to Functional and Kernel tests AFAICS - should be on any test class actually

mondrake’s picture

alexpott’s picture

Yep let's merge with the rule created by #3548982: Enforce removal of PHPUnit annotations from test classes' class metadata which I've just merged... good idea @mondrake and yes the group attribute should be on all tests.

The other question is what about the deprecation... I think we need to leave it there for contrib - but we should consider changing it to a E_USER_NOTICE and not silencing it - but let's tackle that in a separate issue.

alexpott’s picture

Status: Needs work » Needs review

Addressed #5

mondrake’s picture

Status: Needs review » Reviewed & tested by the community

Cool.

mondrake’s picture

Issue tags: +PHPUnit 11

longwave made their first commit to this issue’s fork.

catch’s picture

Version: 11.x-dev » 11.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x and cherry-picked to 11.3.x, thanks!

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.

  • catch committed 90dd2d45 on 11.3.x
    fix: #3556315 Current approach to ensuring RunTestsInSeparateProcesses...

  • catch committed 8e1a45a4 on 11.x
    fix: #3556315 Current approach to ensuring RunTestsInSeparateProcesses...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.