X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FCatalyst%2FPlugin%2FTest%2FPlugin.pm;h=1d39c7b0bfe182af3a8e8040a41bed824a59c9ec;hb=a08216220afae9a832742a5154b96997fef11b26;hp=62b2cad86e24feb354339f4702b56614014180d9;hpb=66741f94ac93b7ba0989db3556d0e3fe36c1be87;p=catagits%2FCatalyst-Runtime.git diff --git a/t/lib/Catalyst/Plugin/Test/Plugin.pm b/t/lib/Catalyst/Plugin/Test/Plugin.pm index 62b2cad..1d39c7b 100644 --- a/t/lib/Catalyst/Plugin/Test/Plugin.pm +++ b/t/lib/Catalyst/Plugin/Test/Plugin.pm @@ -1,8 +1,10 @@ package Catalyst::Plugin::Test::Plugin; use strict; +use warnings; +use MRO::Compat; -use base qw/Catalyst::Base Class::Data::Inheritable/; +use base qw/Catalyst::Controller Class::Data::Inheritable/; __PACKAGE__->mk_classdata('ran_setup'); @@ -11,15 +13,23 @@ sub setup { $c->ran_setup('1'); } -sub prepare { - +sub prepare { my $class = shift; - my $c = $class->NEXT::prepare(@_); + my $c = $class->next::method(@_); $c->response->header( 'X-Catalyst-Plugin-Setup' => $c->ran_setup ); return $c; +} +# Note: Catalyst::Plugin::Server forces the body to +# be parsed, by calling the $c->req->body method in prepare_action. +# We need to test this, as this was broken by 5.80. See also +# t/aggregate/live_engine_request_body.t. +sub prepare_action { + my $c = shift; + $c->res->header('X-Have-Request-Body', 1) if $c->req->body; + $c->next::method(@_); } sub end : Private {