Merge branch 'merge-DEV_2'
[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 /ext-http/.print_request.php HTTP/1.1
35 User-Agent: %s
36 Host: dev.iworks.at
37 Accept: */*
38 Content-Length: 6
39 Content-Type: application/x-www-form-urlencoded
40 X-Original-Content-Length: 6
41
42 foobar
43 HTTP/1.1 200 OK
44 Vary: %s
45 Content-Type: text/html
46 Date: %s
47 Server: %s
48 X-Original-Transfer-Encoding: chunked
49 Content-Length: 19
50
51 string(6) "foobar"
52
53 POST /ext-http/.print_request.php HTTP/1.1
54 User-Agent: %s
55 Host: dev.iworks.at
56 Accept: */*
57 Content-Length: 6
58 Content-Type: application/x-www-form-urlencoded
59 X-Original-Content-Length: 6
60
61 foobar
62 HTTP/1.1 200 OK
63 Vary: %s
64 Content-Type: text/html
65 Date: %s
66 Server: %s
67 X-Original-Transfer-Encoding: chunked
68 Content-Length: 19
69
70 string(6) "foobar"
71
72 POST /ext-http/.print_request.php HTTP/1.1
73 User-Agent: %s
74 Host: dev.iworks.at
75 Accept: */*
76 Content-Length: 6
77 Content-Type: application/x-www-form-urlencoded
78 X-Original-Content-Length: 6
79
80 foobar
81 HTTP/1.1 200 OK
82 Vary: %s
83 Content-Type: text/html
84 Date: %s
85 Server: %s
86 X-Original-Transfer-Encoding: chunked
87 Content-Length: 19
88
89 string(6) "foobar"
90
91 Done