add missing tests
authorMichael Wallner <mike@php.net>
Mon, 26 Mar 2012 07:58:56 +0000 (07:58 +0000)
committerMichael Wallner <mike@php.net>
Mon, 26 Mar 2012 07:58:56 +0000 (07:58 +0000)
package.xml
php_http.h
tests/envrequestbody002.phpt [new file with mode: 0644]
tests/envrequestbody003.phpt [new file with mode: 0644]

index 6aceacc..266cce7 100644 (file)
@@ -38,11 +38,7 @@ Extended HTTP support. Again. Keep in mind that it's got the major version 2, be
  </stability>
  <license>BSD, revised</license>
  <notes><![CDATA[
-+ Added population of $_POST and $_FILES for non-POST requests
-- Renamed http\Env\Request::getPost() to ::getForm()
-- Changed http\Env\Response::setContentDisposition() to take an http\Params like array as argument
-- Removed http\Env\Response::CONTENT_DISPOSOTION_* constants
-- Removed http\Request\Method class; request methods are now used as simple strings
++ 
 ]]></notes>
  <contents>
   <dir name="/">
@@ -131,6 +127,8 @@ Extended HTTP support. Again. Keep in mind that it's got the major version 2, be
      <file role="test" name="urls.txt"/>
     </dir>
     <file role="test" name="envrequestbody001.phpt"/>
+    <file role="test" name="envrequestbody002.phpt"/>
+    <file role="test" name="envrequestbody003.phpt"/>
     <file role="test" name="envrequestheader001.phpt"/>
     <file role="test" name="envresponseheader001.phpt"/>
     <file role="test" name="envresponseranges001.phpt"/>
index de67ea3..e8d5e40 100644 (file)
@@ -13,7 +13,7 @@
 #ifndef PHP_EXT_HTTP_H
 #define PHP_EXT_HTTP_H
 
-#define PHP_HTTP_EXT_VERSION "2.0.0dev9"
+#define PHP_HTTP_EXT_VERSION "2.0.0dev"
 
 extern zend_module_entry http_module_entry;
 #define phpext_http_ptr &http_module_entry
diff --git a/tests/envrequestbody002.phpt b/tests/envrequestbody002.phpt
new file mode 100644 (file)
index 0000000..ec7d2d5
--- /dev/null
@@ -0,0 +1,20 @@
+--TEST--
+env request body
+--SKIPIF--
+<? include "skipif.inc";
+--PUT--
+Content-Type: application/x-www-form-urlencoded
+foo=bar&baz=buh
+--FILE--
+<?
+var_dump($_POST);
+?>
+DONE
+--EXPECT--
+array(2) {
+  ["foo"]=>
+  string(3) "bar"
+  ["baz"]=>
+  string(3) "buh"
+}
+DONE
diff --git a/tests/envrequestbody003.phpt b/tests/envrequestbody003.phpt
new file mode 100644 (file)
index 0000000..a22dbbd
--- /dev/null
@@ -0,0 +1,48 @@
+--TEST--
+env request body
+--SKIPIF--
+<? include "skipif.inc";
+--PUT--
+Content-Type: multipart/form-data;boundary=123
+--123
+Content-Disposition: form-data; name="foo"
+
+bar
+--123
+Content-Disposition: form-data; name="baz"
+
+buh
+--123
+Content-Disposition: form-data; name="up"; filename="up.txt"
+
+foo=bar&baz=buh
+--123--
+--FILE--
+<?
+var_dump($_POST);
+var_dump($_FILES);
+?>
+DONE
+--EXPECTF--
+array(2) {
+  ["foo"]=>
+  string(3) "bar"
+  ["baz"]=>
+  string(3) "buh"
+}
+array(1) {
+  ["up"]=>
+  array(5) {
+    ["name"]=>
+    string(6) "up.txt"
+    ["type"]=>
+    string(0) ""
+    ["tmp_name"]=>
+    string(14) "%s"
+    ["error"]=>
+    int(0)
+    ["size"]=>
+    int(15)
+  }
+}
+DONE