c544cb5d218fbb0f076e4932a7256bc016d86fba
[m6w6/ext-http] / tests / client008.phpt
1 --TEST--
2 client pipelining
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 skip_client_test();
7 if (version_compare(http\Client\Curl\Versions\CURL, "7.62.0", ">=")) {
8 die("skip CURL_VERSION >= 7.62 -- pipelining disabled\n");
9 }
10 ?>
11 --FILE--
12 <?php
13
14 include "helper/server.inc";
15
16 echo "Test\n";
17
18 server("pipeline.inc", function($port, $stdin) {
19 fputs($stdin, "2\n");
20
21 $request = new http\Client\Request("GET", "http://localhost:$port");
22
23 $client = new http\Client();
24 $client->configure(array("pipelining" => false, "use_eventloop" => true));
25
26 $client->enqueue($request);
27 $client->send();
28
29 $client->enqueue(clone $request);
30 $client->enqueue(clone $request);
31
32 $client->send();
33
34 while ($client->getResponse()) {
35 echo "R\n";
36 }
37 });
38
39 ?>
40 Done
41 --EXPECTREGEX--
42 Test
43 (?:R
44 R
45 R
46 )+Done