Phase 1: Test infrastructure (unit/functional split, DAMA + Liip + messenger-test)#75
Merged
Conversation
- Split phpunit.xml.dist into `unit` and `functional` test suites - Add dama/doctrine-test-bundle for per-test transaction rollback - Add liip/test-fixtures-bundle for reloading fixtures from src/DataFixtures - Bump symfony/phpunit-bridge to ^7.3 to match Symfony 7.x - Move existing tests under tests/Unit/; update namespaces - Add tests/Fixtures/TestUserFixtures.php with one user per role - Add tests/Functional/AbstractAdminTestCase.php base class with loginAs() + loadFixtures() - Configure .env.test with null mailer transport - Update CHANGELOG.md Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The bridge was effectively unused: `simple-phpunit` never runs because phpunit/phpunit is a direct dep, SYMFONY_DEPRECATIONS_HELPER was set to 999999 (unlimited), and ClockMock/DnsMock/ExpectDeprecationTrait have no references in the codebase. Drop the dep, simplify bin/phpunit to a single require, and clean up the .gitignore/recipe remnants. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Upgrade from ^10.3 to ^12 (latest 12.5.23). All 22 existing tests pass unchanged; PHPStan and CS checks remain green. DAMA doctrine-test-bundle, liip test-fixtures-bundle, and phpstan-phpunit are all compatible. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- zenstruck/messenger-test: fluent transport assertions for the upcoming Messenger pipeline tests (Phase 2). Bundle auto-enabled in test env. - ergebnis/phpunit-slow-test-detector: flags tests exceeding 1s as a CI hygiene signal. Registered as PHPUnit extension. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #75 +/- ##
=========================================
Coverage 3.70% 3.71%
- Complexity 1251 1261 +10
=========================================
Files 162 162
Lines 4448 4440 -8
=========================================
Hits 165 165
+ Misses 4283 4275 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
First of four PRs implementing the test coverage plan. This PR lands the test infrastructure only — no new tests are added yet (those come in Phases 2–4).
phpunit.xml.distintounitandfunctionalsuites; existing 8 test files moved undertests/Unit/(git-renamed, namespaces updated toApp\Tests\Unit\*).dama/doctrine-test-bundle— auto transaction rollback per test (wired as PHPUnit extension).liip/test-fixtures-bundle— reload fixtures from the existingsrc/DataFixtures/classes.zenstruck/messenger-test— fluent transport assertions for the Messenger pipeline tests in Phase 2.ergebnis/phpunit-slow-test-detector— flags tests exceeding 1s duration.phpunit/phpunitfrom^10.3to^12(latest 12.5.23). All existing tests pass unchanged.symfony/phpunit-bridge:simple-phpunitnever ran (real PHPUnit is a direct dep),SYMFONY_DEPRECATIONS_HELPERwas set to999999(effectively disabled), and noClockMock/DnsMock/ExpectDeprecationTraitreferences exist.bin/phpunitsimplified accordingly.tests/Fixtures/TestUserFixtures.php— one user per role (SUPER_ADMIN, ADMIN, EDITOR, ORG_ADMIN, two ORG_EDITORs scoped to different orgs) for the functional tests that land in Phase 3.tests/Functional/AbstractAdminTestCase.php—WebTestCasebase withloginAs($email)andloadFixtures()helpers..env.testwithMAILER_DSN=null://null.Test plan
task test— 22/22 passing under PHPUnit 12.5.23task code-analysis:phpstan— cleancomposer run coding-standards-check— cleanNext PRs on this branch sequence:
feature/test-coverage-pipeline— MessageHandler + Factory + E2E golden-path tests (useszenstruck/messenger-test)feature/test-coverage-security— Voter unit tests + auth/dashboard/CRUD functional tests (usesAbstractAdminTestCase+TestUserFixtures)feature/test-coverage-ci— split CI steps per suite, Codecov flags🤖 Generated with Claude Code