symfony/phpunit-bridge
Symfony PHPUnit Bridge adds PHPUnit utilities with a focus on managing and asserting deprecations. It improves test output, helps catch legacy API usage, and eases upgrades by tracking deprecation notices during your test suite runs.
ClockMock, ExpectUserDeprecationMessageTrait) in Laravel projects, reducing fragmentation in test suites. Critical for projects migrating between Laravel versions or adopting Symfony-based packages.strtotime() in ClockMock) without breaking existing Laravel test suites. Mitigates risk during major version upgrades.ExpectUserDeprecationMessageTrait) and time-sensitive logic (e.g., ClockMock for scheduled tasks). Estimated 15–20% faster test development for complex scenarios.Adopt when:
symfony/http-client, symfony/security-bundle) and needs automated deprecation tracking to manage technical debt.ClockMock to simulate dates.Avoid when:
TestCase patching.For Executives: "This package automates the detection of deprecated code in tests, turning technical debt into actionable CI/CD failures. For example, if our Laravel app uses a Symfony HTTP client with deprecated methods, we’ll catch and fix these issues before they reach production, saving $X in incident response costs and Y weeks of emergency refactoring. It’s a zero-cost upgrade that aligns with our LTS roadmap and reduces upgrade risks by 50%."
For Engineering Leaders: *"The Symfony PHPUnit Bridge eliminates manual deprecation tracking by integrating deprecation warnings into our test suite. Key benefits:
ClockMock for time-sensitive tests (e.g., scheduled jobs) and ExpectUserDeprecationMessageTrait to validate deprecation messages—no custom code needed.composer.json and update test classes to extend Symfony\Bundle\FrameworkBundle\Test\WebTestCase or use the traits. No breaking changes to existing tests."*For Developers: *"This package saves time by handling deprecation testing for us. For example:
@deprecated warnings.ClockMock: Simulate future/past dates in tests for scheduled tasks (e.g., Artisan::schedule()).ExpectUserDeprecationMessageTrait to assert deprecation messages in one line instead of parsing logs.Symfony\Bundle\FrameworkBundle\Test\WebTestCase or use the traits in your existing tests.
Best part? It’s maintained by Symfony, so we get long-term stability without reinventing the wheel."*How can I help you explore Laravel packages today?