Conversation
|
Hi @TomasVotruba 👋 Thank you for reviewing and merging #131 — glad the Entropy console migration is in main now. I've opened a follow-up PR that expands the PHPUnit suite to 100% line and method coverage (175 tests, up from ~40%). It adds tests for commands, finders, node visitors, and smoke test generation, plus a few small edge-case fixes in src/ where coverage uncovered unreachable or untested branches. Would you have time to take a look when you get a chance? Happy to adjust anything if you'd prefer a smaller scope (e.g. tests only, without the Docker setup). Thanks again for the merge on the previous one! |
This commit introduces two new XML files, `coverage-priv.xml` and `coverage.xml`, which contain detailed coverage metrics for the `Rector\SwissKnife` project. These files provide insights into code coverage for various classes and methods, aiding in maintaining high code quality and ensuring comprehensive testing.
|
Thanks for your pull request! I appreciate you taking the time to submit this; however, it appears this contribution may have been primarily AI-generated without careful human review and consideration. We've found that AI-generated code often doesn't align well with our conventions, architectural decisions, and the specific context of what we're trying to accomplish with the framework. Quality contributions require thoughtful human insight into the codebase. If you're interested in contributing, I'd encourage you to familiarize yourself with the existing codebase, engage with the community, and submit PRs that reflect your own understanding and careful consideration of the problem you're solving. |
Summary
Expands the PHPUnit suite to 175 tests with 100% line and method coverage locally (~40% before). Adds coverage for commands, finders, node visitors, smoke test generation, and testing utilities.
All Code Analysis checks pass on PHP 8.4 (PHPUnit, PHPStan level 8, Rector, ECS, composer-dependency-analyser, etc.).
What changed
Tests
pretty-json,finalize-classes,privatize-constants,search-regex, smoke test generation, …)FilesFinder, PhpParser node visitors,MockedClassResolver,TraitSpotter, value objects, and related servicespretty-json)composer-dependency-analysergreen)PHPUnit configuration
phpunit.xml— tests only (CI runsvendor/bin/phpunitwithcoverage: none)phpunit.coverage.xml— coverage reports for local runsMinor
src/adjustments (edge cases exposed by coverage)FilesFinder::findJsonFiles()— skip empty directory lists before iterating FindernamespacedNameis missingMockWire—Assert::classExists()before PHPUnit mocker creationContainerFactory— autodiscoverTesting/CommandKernelTestCasestub — extendsPHPUnit\Framework\TestCaseLocal development (optional)
docker/test.sh,docker/coverage.shCoverage
Test plan
vendor/bin/phpunit— 175 tests, all passingcomposer phpstan— level 8, no errorsvendor/bin/composer-dependency-analyser— no issuesphpunit.coverage.xml)Optional comment
CI is green on PHP 8.4. Coverage config is split into
phpunit.coverage.xmlso CI can run without pcov/xdebug. Test fixtures no longer reference Doctrine classes.