donatj/mock-webserver
Lightweight PHP mock web server for tests and local development. Spin up an HTTP server on a random port, enqueue canned responses, inspect received requests, and simulate endpoints reliably. Handy for integration tests without external services.
PHP_BINARY PATH resolution), enabling zero-maintenance CI pipelines for GitHub Actions, CircleCI, or self-hosted runners using modern OS versions.v1 with v2).port not open errors).Http::fake().nock for Node).For Executives:
*"v2.10.0 of mock-webserver is a security-critical update that drops PHP <7.2 support to patch CVE-2026-24765, a PHPUnit vulnerability. Here’s why it’s a must-adopt:
PHP_BINARY improvements—saving 2+ hours/week in debug time.MockWebServer with the new version."*For Engineering:
*"Breaking change alert: PHP 7.2+ is now required for mock-webserver v2.10.0 due to a PHPUnit CVE. But the fixes are game-changing:
✅ macOS 26.3+ CI: No more port not open errors—PHP_BINARY is now resolved correctly.
✅ Security: Drops PHP <7.2 to block GHSA-vvj3-c3rp-c85p.
✅ Performance: Mock Stripe webhooks or external APIs in milliseconds (no WireMock overhead).
✅ Laravel-native: Works with Http::fake() or standalone.
Use it for: API clients, webhook tests, or any HTTP logic. Avoid if:
Http::fake()).$mock = new MockWebServer();
$mock->respondWhen('/stripe/webhooks', '{"status": "paid"}');
// Works on macOS 26.3+, PHP 7.2+, and CI!"
For Developers: *"Upgrade to v2.10.0—but first, check your PHP version:
Http::fake().
Key improvements:PHP_BINARY).composer.json: "donatj/mock-webserver": "^2.10".new MockWebServer()—no other code changes!
Need help? Check the changelog."*How can I help you explore Laravel packages today?