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");
28 $SIG{__WARN__} = sub {
30 Test::More::is($error, "You called ->params with an undefined value at t/undef-params.t line 20.\n");
33 MyApp->setup, 'setup app';
36 ok my $psgi = MyApp->psgi_app, 'build psgi app';
38 test_psgi $psgi, sub {
40 my $res = $cb->(GET "/root/test");
41 is $res->code, 200, 'OK';