update travis-pecl
[m6w6/ext-http] / tests / client011.phpt
1 --TEST--
2 client history
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 skip_online_test();
7 skip_client_test();
8 ?>
9 --FILE--
10 <?php
11
12 echo "Test\n";
13
14 $body = new http\Message\Body;
15 $body->append("foobar");
16
17 $request = new http\Client\Request;
18 $request->setBody($body);
19 $request->setRequestMethod("POST");
20 $request->setRequestUrl("http://dev.iworks.at/ext-http/.print_request.php");
21
22 $client = new http\Client;
23 $client->recordHistory = true;
24
25 $client->enqueue($request)->send();
26 echo $client->getHistory()->toString(true);
27
28 $client->requeue($request)->send();
29 echo $client->getHistory()->toString(true);
30
31 ?>
32 Done
33 --EXPECTF--
34 Test
35 POST http://dev.iworks.at/ext-http/.print_request.php HTTP/1.1
36 Content-Length: 6
37
38 foobar
39 HTTP/1.1 200 OK
40 Vary: %s
41 Content-Type: text/html
42 Date: %s
43 Server: %s
44 X-Original-Transfer-Encoding: chunked
45 Content-Length: 19
46
47 string(6) "foobar"
48
49 POST http://dev.iworks.at/ext-http/.print_request.php HTTP/1.1
50 Content-Length: 6
51
52 foobar
53 HTTP/1.1 200 OK
54 Vary: %s
55 Content-Type: text/html
56 Date: %s
57 Server: %s
58 X-Original-Transfer-Encoding: chunked
59 Content-Length: 19
60
61 string(6) "foobar"
62
63 POST http://dev.iworks.at/ext-http/.print_request.php HTTP/1.1
64 Content-Length: 6
65
66 foobar
67 HTTP/1.1 200 OK
68 Vary: %s
69 Content-Type: text/html
70 Date: %s
71 Server: %s
72 X-Original-Transfer-Encoding: chunked
73 Content-Length: 19
74
75 string(6) "foobar"
76
77 Done