Merged
Conversation
PHPUnit 12.5.x is stricter about coverage attribution: - Tests that touch classes not listed in CoversClass/UsesClass are marked risky or produce 'not a valid target' warnings with --coverage. ToolExceptionTest: #[UsesClass(DevkitException::class)] ToolException extends DevkitException — parent is touched implicitly. ConfigurationExceptionTest: #[UsesClass(DevkitException::class)] Same reason. QualityReportTest: #[UsesClass(ToolResult::class)] QualityReport helper creates ToolResult instances directly.
Brings test base from 9% (3/33 classes) towards complete coverage.
New test files (12 files / 117 added tests):
tests/Unit/Configuration/
- PhpUnitConfigGeneratorTest (7 tests)
- PhpStanConfigGeneratorTest (7 tests)
- CsFixerConfigGeneratorTest (8 tests)
- PsalmConfigGeneratorTest (7 tests)
- RectorConfigGeneratorTest (7 tests)
tests/Unit/Core/
- MigrationDetectorTest (7 tests — real filesystem)
- ProcessExecutorTest (11 tests)
- DevkitTest (17 tests — init/clean/quality/gitignore)
- ProjectDetectorTest (10 tests)
tests/Unit/Command/
- AbstractCommandTest (17 tests — arg helpers + output helpers)
tests/Unit/Runner/
- RunnersTest (20 tests — all 6 runners + AbstractToolRunner)
tests/Unit/Exception/ (updated: added UsesClass)
- ToolExceptionTest
- ConfigurationExceptionTest
tests/Unit/ValueObject/ (updated: added UsesClass)
- QualityReportTest
Coverage strategy:
- Config generators: assert generated string content
- MigrationDetector: real tmpdir filesystem
- ProcessExecutor: real php -r commands
- Devkit: mock ConfigGenerator/ToolRunner via createMock()
- Runners: real ProcessExecutor + vendor binaries (available in devenv)
- AbstractToolRunner: anonymous class for binary-not-found path (exit 127)
- AbstractCommand: anonymous subclass for argument helpers;
expectNotToPerformAssertions() for fwrite(STDOUT/STDERR) helpers
(fwrite bypasses ob_start output buffering)
walmir-silva
added a commit
that referenced
this pull request
Mar 2, 2026
KcodeComposerGeneratorTest (5 cases): toolName, outputPath, default versions, user version overrides, config section, output newline. bin/build-phar.php: restored to lean build strategy — bundles only src/ and an inline PSR-4 autoloader. Tools install dynamically via kcode init, avoiding prohibitively slow Phar::compressFiles(GZ) on large vendor trees (documented pitfall #12 in devkit KI).
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.
No description provided.