php-vcr/phpunit-testlistener-vcr
PHPUnit TestListener integrating PHP-VCR via @vcr annotations. Automatically turns VCR on/off per test and records/replays HTTP interactions using named cassettes. Install with Composer and register the listener in phpunit.xml.
Adopt if:
Look elsewhere if:
For Executives: "This package lets us record and replay API interactions during testing—like hitting ‘pause’ on external services. It slashes CI costs by 30–50% (fewer real API calls) and makes tests run faster and more reliably. With PHP 8 support, it’s now future-proof for our modern stack. For example, if we’re integrating with Stripe or a payment processor, we can test locally without touching production. It’s a low-risk way to stabilize our test suite and accelerate feature delivery."
For Engineering: *"PHP-VCR + this listener turns PHPUnit into a time machine for HTTP calls. You record a test’s API interactions once, then replay them offline. No more ‘works on my machine’ issues from flaky APIs. New in 3.3.0: PHP 8 support, so it’s now a seamless fit for our upgraded stack. It’s especially useful for:
For Developers:
*"Imagine running phpunit without waiting for slow APIs or hitting rate limits. This package lets you:
GET /api/payments).@vcr, and go. Now with PHP 8 support, it’s perfect for API-heavy projects like [Project X] or [Service Y]."How can I help you explore Laravel packages today?