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