summaryrefslogtreecommitdiffstats
path: root/t/params.t
diff options
context:
space:
mode:
Diffstat (limited to 't/params.t')
-rw-r--r--t/params.t13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/params.t b/t/params.t
index 6d96fee..48fa5dd 100644
--- a/t/params.t
+++ b/t/params.t
@@ -23,4 +23,17 @@ is $req->param('foo'), "baz";
is_deeply $req->all_parameters->{foo}, [ qw(bar baz) ];
is_deeply [ sort keys %{ $req->parameters } ], [ 'bar', 'foo' ];
+use IO::String;
+my $payload="foo=bar&foo=baz&bar=bar";
+my $io = IO::String->new($payload);
+$req = Web::Request->new_from_env({
+ 'REQUEST_METHOD' => 'POST',
+ 'SCRIPT_NAME' => '/foo',
+ 'CONTENT_LENGTH' => length($payload),
+ 'CONTENT_TYPE' => "application/x-www-form-urlencoded",
+ 'psgi.input' => $io,
+});
+is_deeply $req->all_parameters->{foo}, [ qw(bar baz) ];
+is_deeply [ sort keys %{ $req->parameters } ], [ 'bar', 'foo' ];
+
done_testing;