release 1.7.5
[m6w6/ext-http] / tests / HttpRequest_007.phpt
index d8a7e66..8989de1 100644 (file)
@@ -9,35 +9,56 @@ checkcls('HttpRequest');
 <?php
 echo "-TEST\n";
 
-$r = new HttpRequest('http://dev.iworks.at/.print_request.php', HTTP_METH_PUT);
+$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_put.php5', HTTP_METH_PUT);
 $r->recordHistory = true;
 $r->addHeaders(array('content-type' => 'text/plain'));
 $r->setPutFile(__FILE__);
 $r->send();
-var_dump($r->getRawRequestMessage());
+var_dump($r->getHistory()->toString(true));
 echo "Done\n";
 ?>
 --EXPECTF--
-%sTEST
-string(467) "PUT /.print_request.php HTTP/1.1
-User-Agent: PECL::HTTP/0.21.0dev (PHP/5.1.2-dev)
+%aTEST
+string(%d) "PUT /ext-http/.print_put.php5 HTTP/1.1
+User-Agent: PECL::HTTP/%a
 Host: dev.iworks.at
 Accept: */*
-content-type: text/plain
-Content-Length: 278
+Content-Type: text/plain
+Content-Length: %d
 Expect: 100-continue
 
 <?php
 echo "-TEST\n";
 
-$r = new HttpRequest('http://dev.iworks.at/.print_request.php', HTTP_METH_PUT);
+$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_put.php5', HTTP_METH_PUT);
 $r->recordHistory = true;
 $r->addHeaders(array('content-type' => 'text/plain'));
 $r->setPutFile(__FILE__);
 $r->send();
-var_dump($r->getRawRequestMessage());
+var_dump($r->getHistory()->toString(true));
 echo "Done\n";
 ?>
+
+HTTP/1.1 100 Continue
+HTTP/1.1 200 OK
+Date: %a
+Server: %a
+Vary: Accept-Encoding
+Content-Type: text/html
+X-Original-Transfer-Encoding: chunked
+Content-Length: %d
+
+<?php
+echo "-TEST\n";
+
+$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_put.php5', HTTP_METH_PUT);
+$r->recordHistory = true;
+$r->addHeaders(array('content-type' => 'text/plain'));
+$r->setPutFile(__FILE__);
+$r->send();
+var_dump($r->getHistory()->toString(true));
+echo "Done\n";
+?>
+
 "
 Done
-