X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Flib%2FCatalyst%2FPlugin%2FTest%2FPlugin.pm;h=16f3f63af90e38d40dbd81d5c49c0cac9660dafd;hp=2f7c06d0dce364da7429b9b8a269f9b8e14b37e5;hb=a0a66cb803a6ba6c0920c487e9c5d7fa148b7ec3;hpb=cec7aff62facbd4519a306b57081a557477bee37 diff --git a/t/lib/Catalyst/Plugin/Test/Plugin.pm b/t/lib/Catalyst/Plugin/Test/Plugin.pm index 2f7c06d..16f3f63 100644 --- a/t/lib/Catalyst/Plugin/Test/Plugin.pm +++ b/t/lib/Catalyst/Plugin/Test/Plugin.pm @@ -1,34 +1,35 @@ 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'); -no warnings 'Class::C3::Adopt::NEXT'; - sub setup { my $c = shift; $c->ran_setup('1'); } -sub prepare { - +sub prepare { my $class = shift; -# Note: This use of NEXT is deliberately left here (without a use NEXT) -# to ensure back compat, as NEXT always used to be loaded, but -# is now replaced by Class::C3::Adopt::NEXT. - my $c = $class->NEXT::prepare(@_); + my $c = $class->next::method(@_); $c->response->header( 'X-Catalyst-Plugin-Setup' => $c->ran_setup ); return $c; - } -sub end : Private { - my ($self,$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;