Skip to content

Comments

Add test coverage for ReportCommand and Report classes#14

Merged
makomweb merged 4 commits intonextfrom
copilot/sub-pr-10-yet-again
Jan 25, 2026
Merged

Add test coverage for ReportCommand and Report classes#14
makomweb merged 4 commits intonextfrom
copilot/sub-pr-10-yet-again

Conversation

Copy link
Contributor

Copilot AI commented Jan 25, 2026

PR #10 introduced ReportCommand and Report classes without corresponding test coverage. This PR adds comprehensive unit tests matching the repository's established testing patterns.

Changes

Report class tests (9 tests)

  • Classification logic for all supported types (interfaces, exceptions, entities, value objects, uncategorized)
  • Immutability and state accumulation behavior

ReportCommand tests (10 tests)

  • Command execution with various input scenarios (valid folder, custom output dir, non-existent paths)
  • File generation validation (index.html, report.js, chart.js, styles.css)
  • JSON/HTML structure and content verification
  • Error handling and graceful failure
  • Directory creation for nested paths

Test infrastructure

  • ReportNormalizer for serializing readonly Report instances in tests
  • Temporary directory management with proper cleanup
  • Type-safe file operations (handles file_get_contents() and getcwd() returning false)

Test results

  • 35 total tests (16 original + 19 new), 140 assertions
  • PHPStan and PHP-CS-Fixer passing

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 25, 2026 14:48
Co-authored-by: makomweb <1567373+makomweb@users.noreply.github.com>
Co-authored-by: makomweb <1567373+makomweb@users.noreply.github.com>
Co-authored-by: makomweb <1567373+makomweb@users.noreply.github.com>
Copilot AI changed the title [WIP] Update addressing feedback on CLI report generation command Add test coverage for ReportCommand and Report classes Jan 25, 2026
Copilot AI requested a review from makomweb January 25, 2026 14:52
@makomweb makomweb marked this pull request as ready for review January 25, 2026 15:09
@makomweb makomweb merged commit c4cd20c into next Jan 25, 2026
@makomweb makomweb deleted the copilot/sub-pr-10-yet-again branch January 25, 2026 15:11
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.

2 participants