- fixed message chain order in HttpRequest::getHistory()
[m6w6/ext-http] / tests / HttpRequest_007.phpt
1 --TEST--
2 HttpRequest PUT
3 --SKIPIF--
4 <?php
5 include 'skip.inc';
6 checkcls('HttpRequest');
7 ?>
8 --FILE--
9 <?php
10 echo "-TEST\n";
11
12 $r = new HttpRequest('http://dev.iworks.at/.print_put.php5', HTTP_METH_PUT);
13 $r->recordHistory = true;
14 $r->addHeaders(array('content-type' => 'text/plain'));
15 $r->setPutFile(__FILE__);
16 $r->send();
17 var_dump($r->getHistory()->toString(true));
18 echo "Done\n";
19 ?>
20 --EXPECTF--
21 %sTEST
22 string(%d) "PUT /.print_put.php5 HTTP/1.1
23 User-Agent: PECL::HTTP/%s
24 Host: dev.iworks.at
25 Accept: */*
26 Content-Type: text/plain
27 Content-Length: 281
28 Expect: 100-continue
29
30 <?php
31 echo "-TEST\n";
32
33 $r = new HttpRequest('http://dev.iworks.at/.print_put.php5', HTTP_METH_PUT);
34 $r->recordHistory = true;
35 $r->addHeaders(array('content-type' => 'text/plain'));
36 $r->setPutFile(__FILE__);
37 $r->send();
38 var_dump($r->getHistory()->toString(true));
39 echo "Done\n";
40 ?>
41
42 HTTP/1.1 100 Continue
43 HTTP/1.1 200 OK
44 Date: %s
45 Server: %s
46 X-Powered-By: %s
47 Vary: Accept-Encoding
48 Content-Type: text/html
49 X-Original-Transfer-Encoding: chunked
50 Content-Length: 281
51
52 <?php
53 echo "-TEST\n";
54
55 $r = new HttpRequest('http://dev.iworks.at/.print_put.php5', HTTP_METH_PUT);
56 $r->recordHistory = true;
57 $r->addHeaders(array('content-type' => 'text/plain'));
58 $r->setPutFile(__FILE__);
59 $r->send();
60 var_dump($r->getHistory()->toString(true));
61 echo "Done\n";
62 ?>
63
64 "
65 Done