guzzlehttp/test-server
Node.js server and PHP controller
Maintainers
0.5.1
2026-06-18 12:02 UTC
Requires
- php: ^7.2.5 || ^8.0
- guzzlehttp/guzzle: ^7.11
- guzzlehttp/psr7: ^2.11
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.8.2
Suggests
None
Provides
None
Conflicts
None
Replaces
None
MIT 652709bb89f1c401ead4bd47069f381e415671f8
- Graham Campbell <hello.woop@gjcampbell.co.uk>
- Michael Dowling <mtdowling.woop@gmail.com>
- Tobias Nyholm <tobias.nyholm.woop@gmail.com>
README
This server has long been part of the Guzzle Http client. Since late 2021 it was extracted to its own package.
The server is useful to use in your integration tests.
Requires Node.js ^20.19 || ^22.13 || >=24 available as node.
use GuzzleHttp\Server\Server; Server::start(); register_shutdown_function(static function () { Server::stop(); }); Server::enqueue([ new Response(201), ]); $myHttpClient = MyClient(); $response = $this->makeRequest('GET', Server::$url); // $response will be 201 $requests = Server::received(); // $request[0] is the one sent by MyClient
