remove dep on Class::Data::Inheritable which isn't needed anymore
[catagits/Catalyst-Runtime.git] / t / lib / Catalyst / Plugin / Test / Plugin.pm
index 8440966..69341b7 100644 (file)
@@ -1,32 +1,36 @@
 package Catalyst::Plugin::Test::Plugin;
+use Moose;
+use MRO::Compat;
 
-use strict;
-
-use base qw/Catalyst::Base Class::Data::Inheritable/;
+with 'Catalyst::ClassData';
 
  __PACKAGE__->mk_classdata('ran_setup');
 
 sub setup {
    my $c = shift;
    $c->ran_setup('1');
-}
 
-sub  prepare {
+   return $c->next::method( @_ );
+}
 
+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(@_);
 }
 
+no Moose;
 1;