e813cdc0c953c018a044569526857e11cdb10d40
[m6w6/ext-http] / tests / client022.phpt
1 --TEST--
2 client http2
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 skip_client_test();
7 skip_http2_test();
8 ?>
9 --FILE--
10 <?php
11
12 include "helper/server.inc";
13
14 echo "Test\n";
15
16 nghttpd(function($port) {
17 $client = new http\Client;
18 $client->setOptions([
19 "protocol" => http\Client\Curl\HTTP_VERSION_2_0,
20 "ssl" => [
21 "cainfo" => __DIR__."/helper/http2.crt",
22 ]
23 ]);
24
25 $request = new http\Client\Request("GET", "https://localhost:$port");
26 $client->enqueue($request);
27 echo $client->send()->getResponse();
28 });
29
30 ?>
31 ===DONE===
32 --EXPECTF--
33 Test
34 HTTP/2 200
35 %a
36
37 <!doctype html>
38 <html>
39 <head>
40 <meta charset="utf-8">
41 <title>HTTP2</title>
42 </head>
43 <body>
44 Nothing to see here.
45 </body>
46 </html>
47 ===DONE===