4 use HTTP::Request::Common;
7 # If someone does $c->req->params(undef) you don't get a very good
8 # error message. This is a test to see if the proposed change improves
13 package MyApp::Controller::Root;
14 $INC{'MyApp/Controller/Root.pm'} = __FILE__;
16 use base 'Catalyst::Controller';
20 my $value = $c->req->param(undef);
22 $c->response->body("This is the body");
25 sub set_params :Local {
27 $c->req->param(foo => 'a', 'b', 'c');
28 $c->res->body(join ',', $c->req->param('foo'));
34 $SIG{__WARN__} = sub {
36 Test::More::like($error, qr[You called ->params with an undefined value])
43 ok my $psgi = MyApp->psgi_app, 'build psgi app';
45 test_psgi $psgi, sub {
49 my $res = $cb->(GET "/root/test");
50 is $res->code, 200, 'OK';
54 my $res = $cb->(GET "/root/set_params");
55 is $res->code, 200, 'OK';
56 is $res->content, 'a,b,c';