X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=trunk%2Ft%2Flib%2FCatalyst%2FPlugin%2FTest%2FPlugin.pm;fp=trunk%2Ft%2Flib%2FCatalyst%2FPlugin%2FTest%2FPlugin.pm;h=f4f835b67eb58472bb83e4d4f6a1050018a22b69;hb=e28a6876ad3e11890226e5bab6df4b0725e0981e;hp=0000000000000000000000000000000000000000;hpb=21c94d83082b43028cafcfb18659090b13d832fa;p=catagits%2FCatalyst-Runtime.git diff --git a/trunk/t/lib/Catalyst/Plugin/Test/Plugin.pm b/trunk/t/lib/Catalyst/Plugin/Test/Plugin.pm new file mode 100644 index 0000000..f4f835b --- /dev/null +++ b/trunk/t/lib/Catalyst/Plugin/Test/Plugin.pm @@ -0,0 +1,35 @@ +package Catalyst::Plugin::Test::Plugin; + +use strict; +use warnings; +use MRO::Compat; + +use base qw/Class::Data::Inheritable/; + + __PACKAGE__->mk_classdata('ran_setup'); + +sub setup { + my $c = shift; + $c->ran_setup('1'); +} + +sub prepare { + my $class = shift; + + 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(@_); +} + +1;