chore(tests): move @covers to attributes for PHPUnit 12 - #280
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clears the four PHPUnit runner deprecations the suite reports today:
Four dictionary-import test classes still declared their coverage target as
@coversin a doc-comment. PHPUnit 12 stops reading doc-comment metadata entirely, so@coversthere 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.ArchiveExtractorTestCsvImporterBomTestCsvImporterCanImportTestJsonImporterCanImportTestEach of those class doc-comments existed only to carry the
@coversline, 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.