Fix error: redefinition of typedef 'php_http_message_t' during RHEL build
[m6w6/ext-http] / tests / persistenthandles001.phpt
1 --TEST--
2 persistent handles
3 --SKIPIF--
4 <?php include "skipif.inc"; ?>
5 --FILE--
6 <?php
7 (new http\Request\Factory(array("persistentHandleId" => "foo")))
8 ->createRequest("http://dev.iworks.at")
9 ->setOptions(array("connecttimeout"=> 90, "timeout" =>300))
10 ->send();
11 $r = (new http\Request\Factory(array("persistentHandleId" => "bar")))
12 ->createRequest("http://dev.iworks.at")
13 ->setOptions(array("connecttimeout"=> 90, "timeout" =>300));
14
15 var_dump(http\Env::statPersistentHandles());
16 http\Env::cleanPersistentHandles();
17 var_dump(http\Env::statPersistentHandles());
18
19 $r->send();
20
21 var_dump(http\Env::statPersistentHandles());
22 ?>
23 DONE
24 --EXPECTF--
25 object(stdClass)#%d (3) {
26 ["http_request_datashare.curl"]=>
27 array(0) {
28 }
29 ["http_request_pool.curl"]=>
30 array(0) {
31 }
32 ["http_request.curl"]=>
33 array(2) {
34 ["foo"]=>
35 array(2) {
36 ["used"]=>
37 int(0)
38 ["free"]=>
39 int(1)
40 }
41 ["bar"]=>
42 array(2) {
43 ["used"]=>
44 int(1)
45 ["free"]=>
46 int(0)
47 }
48 }
49 }
50 object(stdClass)#%d (3) {
51 ["http_request_datashare.curl"]=>
52 array(0) {
53 }
54 ["http_request_pool.curl"]=>
55 array(0) {
56 }
57 ["http_request.curl"]=>
58 array(1) {
59 ["bar"]=>
60 array(2) {
61 ["used"]=>
62 int(1)
63 ["free"]=>
64 int(0)
65 }
66 }
67 }
68 object(stdClass)#%d (3) {
69 ["http_request_datashare.curl"]=>
70 array(0) {
71 }
72 ["http_request_pool.curl"]=>
73 array(0) {
74 }
75 ["http_request.curl"]=>
76 array(1) {
77 ["bar"]=>
78 array(2) {
79 ["used"]=>
80 int(1)
81 ["free"]=>
82 int(0)
83 }
84 }
85 }
86 DONE