X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=tests%2Fgh-issue92.phpt;fp=tests%2Fgh-issue92.phpt;h=eb604c8d8c143b4f339029847dae5b05e02af274;hp=0000000000000000000000000000000000000000;hb=19b4a9cd20fd1cdf5f896b21a2e7b0e3d177ebe3;hpb=eacf52af5d1479b16ff282b407820383aaf2d532 diff --git a/tests/gh-issue92.phpt b/tests/gh-issue92.phpt new file mode 100644 index 0000000..eb604c8 --- /dev/null +++ b/tests/gh-issue92.phpt @@ -0,0 +1,165 @@ +--TEST-- +gh-issue #93: message body add form ignores numeric indices +--SKIPIF-- + +--FILE-- +addForm( + array("foo", "bar", "baz"), + array( + array( + "file" => __FILE__, + "name" => "upload", + "type" => "text/plain", + ), + "dir" => array( + array( + "file" => __FILE__, + "name" => 1, + "type" => "text/plain", + ), + array( + "file" => __FILE__, + "name" => 2, + "type" => "text/plain", + ), + ), + ) +); + +echo $temp; + +?> +DONE +--EXPECTF-- +Test +--%x.%x +Content-Disposition: form-data; name="0" + +foo +--%x.%x +Content-Disposition: form-data; name="1" + +bar +--%x.%x +Content-Disposition: form-data; name="2" + +baz +--%x.%x +Content-Disposition: form-data; name="upload"; filename="gh-issue92.php" +Content-Transfer-Encoding: binary +Content-Type: text/plain + +addForm( + array("foo", "bar", "baz"), + array( + array( + "file" => __FILE__, + "name" => "upload", + "type" => "text/plain", + ), + "dir" => array( + array( + "file" => __FILE__, + "name" => 1, + "type" => "text/plain", + ), + array( + "file" => __FILE__, + "name" => 2, + "type" => "text/plain", + ), + ), + ) +); + +echo $temp; + +?> +DONE + +--%x.%x +Content-Disposition: form-data; name="dir[1]"; filename="gh-issue92.php" +Content-Transfer-Encoding: binary +Content-Type: text/plain + +addForm( + array("foo", "bar", "baz"), + array( + array( + "file" => __FILE__, + "name" => "upload", + "type" => "text/plain", + ), + "dir" => array( + array( + "file" => __FILE__, + "name" => 1, + "type" => "text/plain", + ), + array( + "file" => __FILE__, + "name" => 2, + "type" => "text/plain", + ), + ), + ) +); + +echo $temp; + +?> +DONE + +--%x.%x +Content-Disposition: form-data; name="dir[2]"; filename="gh-issue92.php" +Content-Transfer-Encoding: binary +Content-Type: text/plain + +addForm( + array("foo", "bar", "baz"), + array( + array( + "file" => __FILE__, + "name" => "upload", + "type" => "text/plain", + ), + "dir" => array( + array( + "file" => __FILE__, + "name" => 1, + "type" => "text/plain", + ), + array( + "file" => __FILE__, + "name" => 2, + "type" => "text/plain", + ), + ), + ) +); + +echo $temp; + +?> +DONE + +--%x.%x-- +DONE