- happy new year
[m6w6/ext-http] / tests / HttpRequest_009.phpt
diff --git a/tests/HttpRequest_009.phpt b/tests/HttpRequest_009.phpt
new file mode 100644 (file)
index 0000000..ead16d8
--- /dev/null
@@ -0,0 +1,48 @@
+--TEST--
+HttpRequest callbacks
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkcls('HttpRequest');
+?>
+--FILE--
+<?php
+echo "-TEST\n";
+
+class _R extends HttpRequest
+{
+       function onProgress($progress)
+       {
+               print_r($progress);
+       }
+       
+       function onFinish()
+       {
+               var_dump($this->getResponseCode());
+       }
+}
+
+$r = new _R('http://dev.iworks.at/.print_request.php', HTTP_METH_POST);
+$r->addPostFile('upload', __FILE__, 'text/plain');
+$r->send();
+
+echo "Done\n";
+?>
+--EXPECTF--
+%sTEST
+Array
+(
+    [dltotal] => %f
+    [dlnow] => %f
+    [ultotal] => %f
+    [ulnow] => %f
+)
+%srray
+(
+    [dltotal] => %f
+    [dlnow] => %f
+    [ultotal] => %f
+    [ulnow] => %f
+)
+int(200)
+Done