1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
--TEST--
message body add form
--SKIPIF--
<?php
include "skipif.inc";
?>
--FILE--
<?php
echo "Test\n";
$temp = new http\Message\Body;
$temp->addForm(
array(
"foo" => "bar",
"more" => array(
"bah", "baz", "fuz"
),
),
array(
array(
"file" => __FILE__,
"name" => "upload",
"type" => "text/plain",
)
)
);
echo $temp;
?>
DONE
--EXPECTF--
Test
--%x.%x
Content-Disposition: form-data; name="foo"
bar
--%x.%x
Content-Disposition: form-data; name="more[0]"
bah
--%x.%x
Content-Disposition: form-data; name="more[1]"
baz
--%x.%x
Content-Disposition: form-data; name="more[2]"
fuz
--%x.%x
Content-Disposition: form-data; name="upload"; filename="%s"
Content-Transfer-Encoding: binary
Content-Type: text/plain
<?php
echo "Test\n";
$temp = new http\Message\Body;
$temp->addForm(
array(
"foo" => "bar",
"more" => array(
"bah", "baz", "fuz"
),
),
array(
array(
"file" => __FILE__,
"name" => "upload",
"type" => "text/plain",
)
)
);
echo $temp;
?>
DONE
--%x.%x--
DONE
|