X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FCatalyst%2FPlugin%2FTest%2FPlugin.pm;h=809a13a509338e2c0430ecfbb4c19b3b471cfba9;hb=b1e0cb6d4ded3d4223517d4adce6caef23112946;hp=2f7c06d0dce364da7429b9b8a269f9b8e14b37e5;hpb=cec7aff62facbd4519a306b57081a557477bee37;p=catagits%2FCatalyst-Runtime.git diff --git a/t/lib/Catalyst/Plugin/Test/Plugin.pm b/t/lib/Catalyst/Plugin/Test/Plugin.pm index 2f7c06d..809a13a 100644 --- a/t/lib/Catalyst/Plugin/Test/Plugin.pm +++ b/t/lib/Catalyst/Plugin/Test/Plugin.pm @@ -1,13 +1,13 @@ package Catalyst::Plugin::Test::Plugin; use strict; +use warnings; +use Class::C3; use base qw/Catalyst::Base Class::Data::Inheritable/; __PACKAGE__->mk_classdata('ran_setup'); -no warnings 'Class::C3::Adopt::NEXT'; - sub setup { my $c = shift; $c->ran_setup('1'); @@ -27,6 +27,24 @@ sub prepare { } +# Note: This is horrible, but 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. Better ways to test this +# appreciated if you have suggestions :) +{ + my $have_req_body = 0; + sub prepare_action { + my $c = shift; + $have_req_body++ if $c->req->body; + $c->next::method(@_); + } + sub have_req_body_in_prepare_action : Local { + my ($self, $c) = @_; + $c->res->body($have_req_body); + } +} + sub end : Private { my ($self,$c) = @_; }