- Issue created by @mondrake
- 🇮🇹Italy mondrake 🇮🇹
IMHO it makes no sense to enforce test method description in docblocks via PHPCS, but rather than starting a code standards discussion I preferred to change the rector rule to create one (using PHPUnit's testdox NamePrettifier) when missing.
- 🇺🇸United States smustgrave
reviewed a few of these, most have been committed and this lines up. No objection.
The Needs Review Queue Bot → tested this issue. It fails the Drupal core commit checks. 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.
- 🇮🇹Italy mondrake 🇮🇹
PHPStan fails in latest pipeline because, since this issue was RTBCed, issue 🐛 The migrate Row class API is incomplete Active has introduced a test method with 2
@covers
annotations. Given this MR removed the@coversDefaultClass
annotation from the class, the annotations added do not have a reference class anymore and therefore PHPStan cannot identify to what methods they refer to.This MR touches 342 files, can therefore become easily stale, and it's requiring non-trivial work to reroll: it's not a rebase, but a full regeneration of the automated patch, reset of the branch, application of the patch, and force push.
I'll ask in Slack if it's worth tagging the issue 'avoid commit conflicts'.
- 🇺🇸United States smustgrave
I've been trying to suggest new tests to use attributes but imagine some will sneak in
- 🇮🇹Italy mondrake 🇮🇹
Regenerated patch and tagged 'Avoid commit conflicts' tag per https://drupal.slack.com/archives/C079NQPQUEN/p1752247969204049
- 🇮🇹Italy mondrake 🇮🇹
#14 thanks, I think we need to accept that commits still add annotations for now, it's too big to stop. We'll enforce later by enabling
PHPUNIT_FAIL_ON_PHPUNIT_DEPRECATION: true
like we're doing in 📌 Complete test annotations to attributes conversion for Drupal/Test/Component Active for component tests. But too early now. - 🇬🇧United Kingdom longwave UK
Some questions:
- Is there a parent meta, because the parent/child links here and in the related issues seem to go round in circles?
- Is there an issue for updating the docs at https://www.drupal.org/node/2116043 → ?
- I agree with #4, happy to advocate for optional method docblocks for tests if there is an issue for that.
- Do we have a longer term plan for
@legacy-covers
? It seems unlikely that upstream will change their mind on the matter.
- 🇮🇹Italy mondrake 🇮🇹
#17
1. No. We need a meta and reparenting all these issues to that. I will open one.
2. Not that I am aware of.
3. Not that I am aware of.
4. No plan. I can only comment that PHPUnit 10+ does have a#[CoversMethod]
, but that only can be set at the class level. So theoretically tests classes could be split per each method that wants to be covered in detail, but that is a lot of work, and manual one. Maybe a policy issue for discusssion?