More CDI related fail
[catagits/Catalyst-Runtime.git] / t / lib / CDICompatTestPlugin.pm
index 43b4270..cc7df1c 100644 (file)
@@ -15,13 +15,28 @@ package CDICompatTestPlugin;
 use strict;
 use warnings;
 use base qw/Class::Accessor::Fast/;
+use MRO::Compat;
 __PACKAGE__->mk_accessors(qw/_config/);
 
 sub setup {
     my $app = shift;
 
     $app->config;
-    $app->NEXT::setup(@_);
+    $app->next::method(@_);
+}
+
+# However, if we are too enthusiastic about adding accessors to the
+# MyApp package, then this method isn't called (as there is a local 
+# symbol already).
+
+# Note - use a different package here, so that Moose's 
+# package detection code doesn't get confused..
+$CDICompatTestPlugin::Data::HAS_RUN_SETUP_FINISHED = 0;
+
+sub setup_finished {
+    my $app = shift;
+    $CDICompatTestPlugin::Data::AS_RUN_SETUP_FINISHED = 1;
+    $app->next::method(@_);
 }
 
 1;