com phpruntests: sample post_raw test: phpt-tests/sampl e_postraw.phpt
| From: | David Soria Parra | Date: | Thu, 23 Apr 2009 12:40:33 +0000 |
| Subject: | com phpruntests: sample post_raw test: phpt-tests/sampl e_postraw.phpt | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-66539@lists.php.net to get a copy of this message | ||
Commit: 229e57ed82f92b33533df0ad09e7e5079c83bf2a
Author: Zoe Slattery <zoe@php.net> Thu, 23 Apr 2009 12:40:33 +0000
Parents: 0bdee3281ed2296488537dca62293c8af93377ef
Branches: master
Link: http://git.php.net/?p=phpruntests.git;a=commitdiff;h=229e57ed82f92b33533df0ad09e7e5079c83bf2a
Log:
sample post_raw test
Changed paths:
A phpt-tests/sample_postraw.phpt
Diff:
diff --git a/phpt-tests/sample_postraw.phpt b/phpt-tests/sample_postraw.phpt
new file mode 100644
index 0000000..3a63f96
--- /dev/null
+++ b/phpt-tests/sample_postraw.phpt
@@ -0,0 +1,42 @@
+--TEST--
+Sample post_raw test
+--POST_RAW--
+Content-type: multipart/form-data, boundary=AaB03x
+
+--AaB03x
+content-disposition: form-data; name="field1"
+
+Hello World
+--AaB03x
+content-disposition: form-data; name="pics"; filename="file1.txt"
+Content-Type: text/plain
+
+abcdef123456789
+--AaB03x--
+--FILE--
+<?php
+var_dump($_POST);
+var_dump($_FILES);
+var_dump(file_get_contents($_FILES["pics"]["tmp_name"]));
+?>
+--EXPECTF--
+array(1) {
+ ["field1"]=>
+ string(11) "Hello World"
+}
+array(1) {
+ ["pics"]=>
+ array(5) {
+ ["name"]=>
+ string(9) "file1.txt"
+ ["type"]=>
+ string(10) "text/plain"
+ ["tmp_name"]=>
+ string(14) "%s"
+ ["error"]=>
+ int(0)
+ ["size"]=>
+ int(15)
+ }
+}
+string(15) "abcdef123456789"