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