We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50c9c6f commit 27fc82fCopy full SHA for 27fc82f
README.md
@@ -0,0 +1,28 @@
1
+# Guzzle test server
2
+
3
+This server has long been part of the Guzzle Http client. Since late 2021 it
4
+was extracted to its own package.
5
6
+The server is useful to use in your integration tests.
7
8
+```php
9
10
+use GuzzleHttp\Server\Server;
11
12
+Server::start();
13
+register_shutdown_function(static function () {
14
+ Server::stop();
15
+});
16
17
+Server::enqueue([
18
+ new Response(201),
19
+]);
20
21
+$myHttpClient = MyClient();
22
+$response = $this->makeRequest('GET', Sever::$url);
23
+// $response will be 201
24
25
+$requests = Server::received();
26
+// $request[0] is the one sent by MyClient
27
28
+```
0 commit comments