Merge branch 'master' of git.php.net:/pecl/http/pecl_http
[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 $client->enqueue(new http\Client\Request("GET", "https://localhost:$port"));
25 echo $client->send()->getResponse();
26 });
27
28 ?>
29 ===DONE===
30 --EXPECTF--
31 Test
32 HTTP/2.0 200
33 %a
34
35 <!doctype html>
36 <html>
37 <head>
38 <meta charset="utf-8">
39 <title>HTTP2</title>
40 </head>
41 <body>
42 Nothing to see here.
43 </body>
44 </html>
45 ===DONE===