requests/test-server
Minimal PHP HTTP test server used by the Requests for PHP library to run its automated CI test suite. Not intended as a standalone server; install via Composer (requires Composer 2.2+) if needed for local testing.
This package is not for application development—it’s a minimal HTTP test server used exclusively by the Requests library’s internal test suite. As a Laravel developer, you’ll almost never need it. Only consider if you’re:
Requests library itself (e.g., updating its HTTP transports).Requests’s test suite for debugging.To start:
git clone https://github.com/RequestsPHP/test-server.gitcomposer install (requires Composer ≥2.2).php server.php (default port: 8888).curl -v http://localhost:8888/status/200.💡 Reality check: Laravel apps use Guzzle (not
Requests) for HTTP. UseHttp::fake()instead—it’s built-in, expressive, and far more powerful.
Requests test runners: If you’re hacking on Requests, integrate test-server into your test bootstrap via phpunit.xml:
<phpunit bootstrap="vendor/requestsphp/test-server/server.php">
(Note: This is illustrative—actual usage is handled by Requests’s own CI scripts.)Requests transports (e.g., cURL vs. stream), hit prebaked endpoints like:
http://localhost:8888/delay/3 → 3-second delayhttp://localhost:8888/status/418 → I’m a teapot responsehttp://localhost:8888/timeout → Simulated timeoutHttp::fake() or Mockery to stub HTTP responses. This server offers no advantage—and is significantly more fragile.8888: Conflicts with other services (e.g., Docker, Valet). Kill any existing process: lsof -i :8888 | grep LISTEN | awk '{print $2}' | xargs kill.Ctrl+C doesn’t clean up cleanly. Manually kill the process: pkill -f server.php.stream_socket_server() limitations or missing php_cli_server support.server.php is still running (ps aux | grep server.php). If curl hits it but your test doesn’t, the issue is likely your client’s timeout or timeout configuration—not the server.How can I help you explore Laravel packages today?