guzzlehttp/test-server

Node.js server and PHP controller

Maintainers

Package info

github.com/guzzle/test-server

Language:JavaScript

pkg:composer/guzzlehttp/test-server

Statistics

Installs: 196 168

Dependents: 5

Suggesters: 0

Stars: 11

Open Issues: 1

0.1.0 2021-10-06 02:56 UTC

This package is auto-updated.

Last update: 2026-02-18 14:21:48 UTC


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.

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