Added body_ref and body_length and minor optimization, use refs where it's possible
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine / Test.pm
index c783be1..f7afec3 100644 (file)
@@ -49,6 +49,15 @@ This class overloads some methods from C<Catalyst::Engine>.
 
 =over 4
 
+=item $c->finalize_body
+
+=cut
+
+sub finalize_body {
+    my $c = shift;
+    $c->http->response->content_ref( $c->response->body_ref );
+}
+
 =item $c->finalize_headers
 
 =cut
@@ -63,13 +72,13 @@ sub finalize_headers {
     }
 }
 
-=item $c->finalize_output
+=item $c->prepare_body
 
 =cut
 
-sub finalize_output {
+sub prepare_body {
     my $c = shift;
-    $c->http->response->content( $c->response->output );
+    $c->request->body( $c->http->request->content );
 }
 
 =item $c->prepare_connection
@@ -82,22 +91,6 @@ sub prepare_connection {
     $c->req->address( $c->http->address );
 }
 
-=item $c->prepare_input
-
-=cut
-
-sub prepare_input {
-    my $c = shift;
-    return unless 
-            $c->request->content_length
-        and $c->request->content_type
-        and $c->request->content_type ne 'application/x-www-form-urlencoded'
-        and $c->request->content_type ne 'multipart/form-data';
-
-    $c->request->input( $c->http->request->content );
-}
-
 =item $c->prepare_headers
 
 =cut
@@ -158,8 +151,8 @@ sub prepare_parameters {
         }
     }
 
-    $c->req->_assign_values( $c->req->parameters, \@params );
-    $c->req->_assign_values( $c->req->uploads, \@uploads );
+    $c->request->param(\@params);
+    $c->request->upload(\@uploads);
 }
 
 =item $c->prepare_path