fix tests
[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 "verifypeer" => false, // needed for NSS without PEM support
23 ]
24 ]);
25
26 $request = new http\Client\Request("GET", "https://localhost:$port");
27 $client->enqueue($request);
28 echo $client->send()->getResponse();
29 });
30
31 ?>
32 ===DONE===
33 --EXPECTF--
34 Test
35 HTTP/2 200
36 %a
37
38 <!doctype html>
39 <html>
40 <head>
41 <meta charset="utf-8">
42 <title>HTTP2</title>
43 </head>
44 <body>
45 Nothing to see here.
46 </body>
47 </html>
48 ===DONE===