Issue #3615901: Remove @group annotation from test files
Removes the legacy class-level @group annotation from all 118 test classes on 4.x. Each already carries the equivalent #[Group('...')] attribute with the same value, and ParserChain::forClass() returns attribute metadata without ever reading the doc-comment once a class has any attribute, so the annotation was inert.
Also converts the remaining doc-comment coverage metadata to attributes (drive-by, same surface): three @coversDefaultClass and the two method-level @covers ::getRouteCollectionCacheId become #[CoversClass]. Those two method annotations were the only doc-comment metadata PHPUnit still parsed here, and the only source of Metadata in doc-comments is deprecated and will no longer be supported in PHPUnit 12 runner deprecations. Measured on DomainSourceRouterProviderTest with --display-phpunit-deprecations: 2 deprecations before, 0 after.
Verified:
- 118 files, 8 insertions / 244 deletions. The removal is the
@groupline plus the now-stray blank doc-comment line above it (116 files); 2 files needed only the tag line removed. phpcswith the gitlab_templatesdrupal-contrib-projectruleset: 441 files, no errors or warnings. A naive one-line delete would have produced Additional blank lines found at end of doc comment in 106 files and There must be exactly one blank line before the tags in a doc comment in 10, so the blank line handling is the substance of the diff.--group domain_sourcestill selects both tests of the converted unit test, which pass.
Not backportable. TestDiscovery's attribute fallback landed in core 11.2.x, so on 3.x / 3.0.x (^10.2 || ^11) removing @group would make run-tests.sh throw MissingGroupException for every class. 4.x requires ^11.4 || ^12, and this project's CI selects tests by --directory rather than by group, so nothing in the pipeline depends on the annotation.
One behaviour note for the record: core's TestDiscovery::getTestInfo() still parses only the doc-comment, so run-tests.sh --group domain will now file these classes under the ##no-group-annotations pseudo-group. run-tests.sh --module domain, --directory, and PHPUnit's own --group domain are unaffected.