5.3->5.2.5
[m6w6/ext-http] / tests / HttpRequest_006.phpt
index 5f933b7248a14e5c5fd89eed9d1219586cf5175f..44afcdeb7510e44aab1484b17acbb49827c04a18 100644 (file)
@@ -10,9 +10,9 @@ checkcls('HttpRequest');
 <?php
 echo "-TEST\n";
 
-$r = new HttpRequest('http://dev.iworks.at/.print_request.php', HTTP_METH_POST);
+$r = new HttpRequest('http://dev.iworks.at/ext-http/.print_request.php', HTTP_METH_POST);
 $r->setContentType('text/xml');
-$r->setRawPostData(xmlrpc_encode_request('testMethod', array('foo' => 'bar')));
+$r->setBody(xmlrpc_encode_request('testMethod', array('foo' => 'bar')));
 var_dump($r->send());
 var_dump($r->send());
 var_dump($r->send());
@@ -20,26 +20,12 @@ var_dump($r->send());
 echo "Done\n";
 ?>
 --EXPECTF--
-%sTEST
+%aTEST
 object(HttpMessage)#%d (%d) {
   ["type:protected"]=>
   int(2)
-  ["httpVersion:protected"]=>
-  float(1.1)
-  ["responseCode:protected"]=>
-  int(200)
-  ["responseStatus:protected"]=>
-  string(2) "OK"
-  ["requestMethod:protected"]=>
-  string(0) ""
-  ["requestUri:protected"]=>
-  string(0) ""
-  ["headers:protected"]=>
-  array(6) {
-    %s
-  }
   ["body:protected"]=>
-  string(309) "string(294) "<?xml version="1.0" encoding="iso-8859-1"?>
+  string(309) "string(294) "<?xml version="1.0" encoding="iso-8859-1%s]>
 <methodCall>
 <methodName>testMethod</methodName>
 <params>
@@ -59,26 +45,28 @@ object(HttpMessage)#%d (%d) {
 </methodCall>
 "
 "
-}
-object(HttpMessage)#%d (%d) {
-  ["type:protected"]=>
-  int(2)
-  ["httpVersion:protected"]=>
-  float(1.1)
-  ["responseCode:protected"]=>
-  int(200)
-  ["responseStatus:protected"]=>
-  string(2) "OK"
   ["requestMethod:protected"]=>
   string(0) ""
-  ["requestUri:protected"]=>
+  ["requestUrl:protected"]=>
   string(0) ""
+  ["responseStatus:protected"]=>
+  string(2) "OK"
+  ["responseCode:protected"]=>
+  int(200)
+  ["httpVersion:protected"]=>
+  float(1.1)
   ["headers:protected"]=>
   array(6) {
-    %s
+    %a
   }
+  ["parentMessage:protected"]=>
+  NULL
+}
+object(HttpMessage)#%d (%d) {
+  ["type:protected"]=>
+  int(2)
   ["body:protected"]=>
-  string(309) "string(294) "<?xml version="1.0" encoding="iso-8859-1"?>
+  string(309) "string(294) "<?xml version="1.0" encoding="iso-8859-1%s]>
 <methodCall>
 <methodName>testMethod</methodName>
 <params>
@@ -98,26 +86,28 @@ object(HttpMessage)#%d (%d) {
 </methodCall>
 "
 "
-}
-object(HttpMessage)#%d (%d) {
-  ["type:protected"]=>
-  int(2)
-  ["httpVersion:protected"]=>
-  float(1.1)
-  ["responseCode:protected"]=>
-  int(200)
-  ["responseStatus:protected"]=>
-  string(2) "OK"
   ["requestMethod:protected"]=>
   string(0) ""
-  ["requestUri:protected"]=>
+  ["requestUrl:protected"]=>
   string(0) ""
+  ["responseStatus:protected"]=>
+  string(2) "OK"
+  ["responseCode:protected"]=>
+  int(200)
+  ["httpVersion:protected"]=>
+  float(1.1)
   ["headers:protected"]=>
   array(6) {
-    %s
+    %a
   }
+  ["parentMessage:protected"]=>
+  NULL
+}
+object(HttpMessage)#%d (%d) {
+  ["type:protected"]=>
+  int(2)
   ["body:protected"]=>
-  string(309) "string(294) "<?xml version="1.0" encoding="iso-8859-1"?>
+  string(309) "string(294) "<?xml version="1.0" encoding="iso-8859-1%s]>
 <methodCall>
 <methodName>testMethod</methodName>
 <params>
@@ -137,5 +127,21 @@ object(HttpMessage)#%d (%d) {
 </methodCall>
 "
 "
+  ["requestMethod:protected"]=>
+  string(0) ""
+  ["requestUrl:protected"]=>
+  string(0) ""
+  ["responseStatus:protected"]=>
+  string(2) "OK"
+  ["responseCode:protected"]=>
+  int(200)
+  ["httpVersion:protected"]=>
+  float(1.1)
+  ["headers:protected"]=>
+  array(6) {
+    %a
+  }
+  ["parentMessage:protected"]=>
+  NULL
 }
 Done