Visitar URL original
Respect CoversNothing in Cest coverage by oiahoon · Pull Request #6947 · Codeception/Codeception · GitHub
Skip to content

Respect CoversNothing in Cest coverage - #6947

Open
oiahoon wants to merge 1 commit into
Codeception:mainfrom
oiahoon:fix/cest-covers-nothing
Open

oiahoon wants to merge 1 commit into
Codeception:mainfrom
oiahoon:fix/cest-covers-nothing

Conversation

@oiahoon

@oiahoon oiahoon commented Jul 12, 2026

Copy link
Copy Markdown

Summary

  • preserve class- and method-level #[CoversNothing] metadata for Cest tests
  • discard coverage collected for those tests before php-code-coverage converts target arrays
  • add focused regression coverage for the sentinel and the coverage end path

Root cause

For PHPUnit 10 and newer, Cest coverage target extraction returned an empty target list for CoversNothing, losing the historical false sentinel. Restoring that sentinel exposed a second issue in php-code-coverage 12 and newer, where it was passed to the array-only TargetCollection::fromArray() API.

Verification

  • php codecept run unit Codeception/Test/CestTest --no-colors
  • php codecept run unit Codeception/Test --no-colors
  • full unit suite: 260 tests, 513 assertions, 6 skipped
  • focused PHPStan analysis of both changed production files
  • production and test PSR-12 checks
  • PHP syntax checks and git diff --check

Fixes #6940

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: #[CoversNothing] is ignored in Cest tests with PHPUnit 13 / php-code-coverage 12

1 participant