diff options
| author | Ondřej Surý <ondrej@sury.org> | 2011-02-16 10:13:02 +0100 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2011-02-16 10:13:02 +0100 |
| commit | fd5a0b31640419ca63d1ddeaffd6d3cf2a741814 (patch) | |
| tree | bfd17d84c5181d7b98d7d66f56573f4fc897e31c /tests/basic | |
| parent | 01fcdff3849c3691d9aaeaab735846ab6d8895ca (diff) | |
| download | php-upstream/5.3.5.tar.gz | |
Imported Upstream version 5.3.5upstream/5.3.5
Diffstat (limited to 'tests/basic')
| -rw-r--r-- | tests/basic/021.phpt | 2 | ||||
| -rw-r--r-- | tests/basic/bug46313-win.phpt | 5 | ||||
| -rw-r--r-- | tests/basic/bug51709_1.phpt | 2 | ||||
| -rw-r--r-- | tests/basic/bug51709_2.phpt | 2 | ||||
| -rw-r--r-- | tests/basic/bug53180.phpt | 19 | ||||
| -rw-r--r-- | tests/basic/rfc1867_max_file_uploads_empty_files.phpt | 101 | ||||
| -rw-r--r-- | tests/basic/rfc1867_max_file_uploads_empty_files_debug.phpt | 102 |
7 files changed, 227 insertions, 6 deletions
diff --git a/tests/basic/021.phpt b/tests/basic/021.phpt index bce6bb3c9..e79ac7dc2 100644 --- a/tests/basic/021.phpt +++ b/tests/basic/021.phpt @@ -1,7 +1,7 @@ --TEST-- Bug #37276 (problems witch $_POST array) --INI-- -file_upload=1 +file_uploads=1 --POST_RAW-- Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 -----------------------------20896060251896012921717172737 diff --git a/tests/basic/bug46313-win.phpt b/tests/basic/bug46313-win.phpt index 1971e807b..87786d44e 100644 --- a/tests/basic/bug46313-win.phpt +++ b/tests/basic/bug46313-win.phpt @@ -28,6 +28,8 @@ var_dump($GLOBALS["o1\'file"]); var_dump($GLOBALS["o1\'file"] === $_FILES["o1\'file"]["tmp_name"]); ?> --EXPECTF-- +Deprecated: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0 +Deprecated: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in Unknown on line 0 array(2) { ["o1\'file"]=> array(5) { @@ -60,6 +62,3 @@ string(12) "o1" bool(true) string(%d) "%s" bool(true) -Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0 -Warning: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in Unknown on line 0 - diff --git a/tests/basic/bug51709_1.phpt b/tests/basic/bug51709_1.phpt index e929df384..8abb92555 100644 --- a/tests/basic/bug51709_1.phpt +++ b/tests/basic/bug51709_1.phpt @@ -13,4 +13,4 @@ class foo { ===DONE=== <?php exit(0); ?> --EXPECTF-- -Parse error: syntax error, unexpected T_FOR, expecting T_STRING in %s/bug51709_1.php on line %d +Parse error: syntax error, unexpected T_FOR, expecting T_STRING in %sbug51709_1.php on line %d diff --git a/tests/basic/bug51709_2.phpt b/tests/basic/bug51709_2.phpt index b6224abcf..7763cafe5 100644 --- a/tests/basic/bug51709_2.phpt +++ b/tests/basic/bug51709_2.phpt @@ -13,4 +13,4 @@ class foo { ===DONE=== <?php exit(0); ?> --EXPECTF-- -Parse error: syntax error, unexpected T_GOTO, expecting T_STRING in %s/bug51709_2.php on line %d +Parse error: syntax error, unexpected T_GOTO, expecting T_STRING in %sbug51709_2.php on line %d diff --git a/tests/basic/bug53180.phpt b/tests/basic/bug53180.phpt new file mode 100644 index 000000000..5c2eb7695 --- /dev/null +++ b/tests/basic/bug53180.phpt @@ -0,0 +1,19 @@ +--TEST--
+Bug #53180 (post_max_size=0 partly not working)
+--INI--
+post_max_size=0
+--POST--
+email=foo&password=bar&submit=Log+on
+--FILE--
+<?php
+var_dump($_POST);
+?>
+--EXPECT--
+array(3) {
+ ["email"]=>
+ string(3) "foo"
+ ["password"]=>
+ string(3) "bar"
+ ["submit"]=>
+ string(6) "Log on"
+}
diff --git a/tests/basic/rfc1867_max_file_uploads_empty_files.phpt b/tests/basic/rfc1867_max_file_uploads_empty_files.phpt new file mode 100644 index 000000000..76327fdb0 --- /dev/null +++ b/tests/basic/rfc1867_max_file_uploads_empty_files.phpt @@ -0,0 +1,101 @@ +--TEST--
+rfc1867 max_file_uploads - empty files shouldn't count (non-debug version)
+--SKIPIF--
+<?php if(function_exists("leak")) print "skip only for non-debug builds"; ?>
+--INI--
+file_uploads=1
+error_reporting=E_ALL
+max_file_uploads=2
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file2"; filename=""
+Content-Type: text/plain-file
+
+
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file3"; filename=""
+Content-Type: text/plain-file
+
+33
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file4"; filename="file4.txt"
+Content-Type: text/plain-file
+
+
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file1"; filename="file1.txt"
+Content-Type: text/plain-file
+
+1
+-----------------------------20896060251896012921717172737--
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+if (is_uploaded_file($_FILES["file1"]["tmp_name"])) {
+ var_dump(file_get_contents($_FILES["file1"]["tmp_name"]));
+}
+if (is_uploaded_file($_FILES["file4"]["tmp_name"])) {
+ var_dump(file_get_contents($_FILES["file4"]["tmp_name"]));
+}
+?>
+--EXPECTF--
+array(4) {
+ ["file2"]=>
+ array(5) {
+ ["name"]=>
+ string(0) ""
+ ["type"]=>
+ string(0) ""
+ ["tmp_name"]=>
+ string(0) ""
+ ["error"]=>
+ int(4)
+ ["size"]=>
+ int(0)
+ }
+ ["file3"]=>
+ array(5) {
+ ["name"]=>
+ string(0) ""
+ ["type"]=>
+ string(0) ""
+ ["tmp_name"]=>
+ string(0) ""
+ ["error"]=>
+ int(4)
+ ["size"]=>
+ int(0)
+ }
+ ["file4"]=>
+ array(5) {
+ ["name"]=>
+ string(9) "file4.txt"
+ ["type"]=>
+ string(15) "text/plain-file"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
+ int(0)
+ ["size"]=>
+ int(0)
+ }
+ ["file1"]=>
+ array(5) {
+ ["name"]=>
+ string(9) "file1.txt"
+ ["type"]=>
+ string(15) "text/plain-file"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
+ int(0)
+ ["size"]=>
+ int(1)
+ }
+}
+array(0) {
+}
+string(1) "1"
+string(0) ""
diff --git a/tests/basic/rfc1867_max_file_uploads_empty_files_debug.phpt b/tests/basic/rfc1867_max_file_uploads_empty_files_debug.phpt new file mode 100644 index 000000000..279851cc2 --- /dev/null +++ b/tests/basic/rfc1867_max_file_uploads_empty_files_debug.phpt @@ -0,0 +1,102 @@ +--TEST--
+rfc1867 max_file_uploads - empty files shouldn't count (debug version)
+--SKIPIF--
+<?php if(!function_exists("leak")) print "skip only for debug builds"; ?>
+--INI--
+file_uploads=1
+error_reporting=E_ALL
+max_file_uploads=1
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file2"; filename=""
+Content-Type: text/plain-file
+
+
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file3"; filename=""
+Content-Type: text/plain-file
+
+33
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file4"; filename="file4.txt"
+Content-Type: text/plain-file
+
+
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file1"; filename="file1.txt"
+Content-Type: text/plain-file
+
+1
+-----------------------------20896060251896012921717172737--
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+if (is_uploaded_file($_FILES["file1"]["tmp_name"])) {
+ var_dump(file_get_contents($_FILES["file1"]["tmp_name"]));
+}
+?>
+--EXPECTF--
+Notice: No file uploaded in Unknown on line 0
+
+Notice: No file uploaded in Unknown on line 0
+
+Warning: Uploaded file size 0 - file [file4=file4.txt] not saved in Unknown on line 0
+array(4) {
+ ["file2"]=>
+ array(5) {
+ ["name"]=>
+ string(0) ""
+ ["type"]=>
+ string(0) ""
+ ["tmp_name"]=>
+ string(0) ""
+ ["error"]=>
+ int(4)
+ ["size"]=>
+ int(0)
+ }
+ ["file3"]=>
+ array(5) {
+ ["name"]=>
+ string(0) ""
+ ["type"]=>
+ string(0) ""
+ ["tmp_name"]=>
+ string(0) ""
+ ["error"]=>
+ int(4)
+ ["size"]=>
+ int(0)
+ }
+ ["file4"]=>
+ array(5) {
+ ["name"]=>
+ string(9) "file4.txt"
+ ["type"]=>
+ string(0) ""
+ ["tmp_name"]=>
+ string(0) ""
+ ["error"]=>
+ int(5)
+ ["size"]=>
+ int(0)
+ }
+ ["file1"]=>
+ array(5) {
+ ["name"]=>
+ string(9) "file1.txt"
+ ["type"]=>
+ string(15) "text/plain-file"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
+ int(0)
+ ["size"]=>
+ int(1)
+ }
+}
+array(0) {
+}
+string(1) "1"
|
