Skip to content

test(config): repair PHPUnit code coverage collection rules#46

Merged
Mike031289 merged 1 commit into
developfrom
test/code-covrage
Jul 17, 2026
Merged

test(config): repair PHPUnit code coverage collection rules#46
Mike031289 merged 1 commit into
developfrom
test/code-covrage

Conversation

@Mike031289

Copy link
Copy Markdown
Owner

This PR addresses an environment configuration issue where the PHPUnit code coverage report was returning exactly 0.00% despite passing tests.

Changes Implemented

  • phpunit.xml Overhaul: Enabled processUncoveredFilesFromWhitelist="true" within the <filter> block. This forces PHPUnit to index all production files inside src/ rather than only tracking files executed by the test suite.
  • Target Scopes: Restricted the whitelist directory to check for .php suffixes strictly, avoiding parsing crashes or mismatches on non-code assets.

Verification & Testing Steps

  1. Run with Xdebug 3 Coverage Mode Enabled:
    • CMD: set XDEBUG_MODE=coverage && vendor\bin\phpunit --coverage-html web\test-coverage
    • PowerShell: $env:XDEBUG_MODE="coverage"; vendor/bin/phpunit --coverage-html web/test-coverage
    • Bash: XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-html web/test-coverage
  2. Output Check: Open web/test-coverage/index.html directly via your local file browser (file:///...). The interactive dashboard now populates with realistic, verified percentages matching the execution paths of the tests/ suite.

- Added processUncoveredFilesFromWhitelist attribute to phpunit.xml
- Enforced php suffix matching on src directory to ensure proper analysis
- Cleaned up target coverage path options
@Mike031289 Mike031289 self-assigned this Jul 17, 2026
@Mike031289 Mike031289 added the documentation Improvements or additions to documentation label Jul 17, 2026
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 duplication

Metric Results
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@Mike031289
Mike031289 merged commit 28f78a5 into develop Jul 17, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in @Mike031289's ToDo-Co Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant