Skip to content

chore(tests): move @covers to attributes for PHPUnit 12 - #280

Merged
HugoFara merged 1 commit into
developfrom
chore/phpunit-metadata-attributes
Aug 23, 2026
Merged

chore(tests): move @covers to attributes for PHPUnit 12#280
HugoFara merged 1 commit into
developfrom
chore/phpunit-metadata-attributes

Conversation

@HugoFara

Copy link
Copy Markdown
Owner

Clears the four PHPUnit runner deprecations the suite reports today:

Metadata found in doc-comment for class ...ArchiveExtractorTest.
Metadata in doc-comments is deprecated and will no longer be supported
in PHPUnit 12. Update your test code to use attributes instead.

Four dictionary-import test classes still declared their coverage target as @covers in a doc-comment. PHPUnit 12 stops reading doc-comment metadata entirely, so @covers there would silently become no coverage target at all rather than an error. The rest of the suite is already on #[CoversClass] — these were the last four.

  • ArchiveExtractorTest
  • CsvImporterBomTest
  • CsvImporterCanImportTest
  • JsonImporterCanImportTest

Each of those class doc-comments existed only to carry the @covers line, and its prose was a copy of the file header directly above it. Rather than leave the duplicate behind, each now says what its tests actually check.

Tests only — no src/ change, no behaviour change.

PHPUnit 9090 pass, 0 deprecations (was 4), PHPCS clean.

Four dictionary-import test classes still carried their coverage target in a
doc-comment, which PHPUnit 11 reports as a runner deprecation and PHPUnit 12
will stop reading altogether. The rest of the suite is already on
#[CoversClass], so these were the last four; the run is now deprecation-free.

Each class doc-comment existed only to hold the @Covers line, so rather than
leave a copy of the file header behind, each now says what its tests actually
check.
@HugoFara HugoFara added the back-end Back-end related issue label Aug 23, 2026
@HugoFara
HugoFara merged commit fca7f93 into develop Aug 23, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

back-end Back-end related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant