dama/doctrine-test-bundle
Symfony test bundle that speeds up Doctrine tests by reusing static DBAL connections and wrapping each test in a transaction that’s rolled back for isolation. Also provides a PSR-6 static array cache for Doctrine metadata/query caching to reduce boot time and memory.
#[SkipDatabaseRollback] for edge cases like debugging).Adopt if:
INSERT/UPDATE conflicts).Look Elsewhere if:
ALTER TABLE) that can’t be rolled back (use temporary test databases instead).AUTOCOMMIT=1; configure use_savepoints: true or refactor)."This package cuts test suite runtime by 50–80% by eliminating redundant database operations. For a team running 2,000 tests daily, that’s ~10–15 hours saved per week in CI costs—equivalent to 2 full-time engineers. It’s a zero-risk upgrade (MIT-licensed, used by Symfony’s demo app) that improves reliability while reducing infrastructure costs. No code changes needed; just install and enable."
Key Outcomes: ✅ Faster releases: Shorter CI feedback loops. ✅ More reliable tests: No flakiness from shared state. ✅ Lower cloud costs: Fewer failed retries due to timeouts. ✅ Future-proof: Works with modern PHP/Symfony stacks.
*"The DAMA Doctrine Test Bundle replaces manual transaction management with a smart, configurable wrapper that:
#[SkipDatabaseRollback]).Implementation:
composer.json (dev dependency).bundles.php and phpunit.xml.use_savepoints: true in Doctrine DBAL (if using DBAL <4).Trade-offs:
Next Steps:
How can I help you explore Laravel packages today?