travis: allow_failures
[m6w6/ext-http] / tests / client018.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 function dump($response) {
19 echo $response->getHeader("X-Req"),"\n";
20 }
21
22 server("pipeline.inc", function($port, $stdin, $stdout, $stderr) {
23 /* tell the server we're about to send 3 pipelined messages */
24 fputs($stdin, "3\n");
25
26 $client = new http\Client(null);
27 $client->configure(array("pipelining" => true, "max_host_connections" => 0));
28
29 /* this is just to let curl know the server may be capable of pipelining */
30 $client->enqueue(new http\Client\Request("GET", "http://localhost:$port"), "dump");
31 $client->send();
32
33 $client->enqueue(new http\Client\Request("GET", "http://localhost:$port/1"), "dump");
34 $client->enqueue(new http\Client\Request("GET", "http://localhost:$port/2"), "dump");
35 $client->enqueue(new http\Client\Request("GET", "http://localhost:$port/3"), "dump");
36 $client->send();
37 });
38
39 ?>
40 ===DONE===
41 --EXPECT--
42 Test
43 /
44 /1
45 /2
46 /3
47 ===DONE===