fix undef values in params sent to uri_with() and uri_for()
[catagits/Catalyst-Runtime.git] / t / lib / TestApp / Controller / Engine / Request / URI.pm
index 100557e..03cf758 100644 (file)
@@ -63,4 +63,18 @@ sub uri_with_utf8 : Local {
     $c->forward('TestApp::View::Dump::Request');\r
 }\r
 \r
+sub uri_with_undef : Local {\r
+    my ( $self, $c ) = @_;\r
+
+    my $warnings = 0;
+    local $SIG{__WARN__} = sub { $warnings++ };\r
+\r
+    # change the current uri
+    my $uri = $c->req->uri_with( { foo => undef } );\r
+    \r
+    $c->res->header( 'X-Catalyst-warnings' => $warnings );\r
+    \r
+    $c->forward('TestApp::View::Dump::Request');\r
+}\r
+\r
 1;\r