Problem/Motivation

Complete removal of PHPUnit annotations from test classes metadata, and ensure no regressions in future.

Proposed resolution

Remove annotations and adjust custom PHPStan rule to prevent regressions.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3548982

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

mondrake created an issue. See original summary.

mondrake’s picture

Title: Complete removal of PHPUnit annotations from test classes metadata » Enforce removal of PHPUnit annotations from test classes' class metadata
Issue summary: View changes
mondrake’s picture

Status: Postponed » Needs review

Unblocked

dcam’s picture

Status: Needs review » Reviewed & tested by the community

This is my first time learning about PHPStan rules. This looks straightforward though.

The Drupal class changes are all 1-for-1 changes from annotations to attributes. I checked them all to make certain the metadata was preserved.

The rule changes are a little more difficult to understand. But they're all about taking a metadata-checking rule that formerly applied to abstract test classes and making it apply to all test classes, abstract or not.

I can't find anything to give feedback about and the PHPStan lint passed. So this looks good to me.

mondrake’s picture

Thank you. I've added some inline comments in the rule code, to explain a bit what's going on. Leaving at RTBC as no code was changed.

dcam’s picture

I've added some inline comments in the rule code, to explain a bit what's going on.

Those look great! I think they help.

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

mondrake’s picture

Status: Needs work » Reviewed & tested by the community

Well, bot...

alexpott’s picture

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

Committed and pushed d6503947baa to 11.x and 1e158cd2921 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.

  • alexpott committed 1e158cd2 on 11.3.x
    Issue #3548982 by mondrake, dcam: Enforce removal of PHPUnit annotations...

  • alexpott committed d6503947 on 11.x
    Issue #3548982 by mondrake, dcam: Enforce removal of PHPUnit annotations...

Status: Fixed » Closed (fixed)

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