Moved ACLTestApp from the test file to an app class and a root controller.
[catagits/Catalyst-Runtime.git] / t / lib / ACLTestApp.pm
diff --git a/t/lib/ACLTestApp.pm b/t/lib/ACLTestApp.pm
new file mode 100644 (file)
index 0000000..ec87027
--- /dev/null
@@ -0,0 +1,26 @@
+package ACLTestApp;
+use Test::More;
+
+use strict;
+use warnings;
+use MRO::Compat;
+use Scalar::Util ();
+
+use base qw/Catalyst Catalyst::Controller/;
+use Catalyst qw//;
+
+sub execute {
+    my $c = shift;
+    my ( $class, $action ) = @_;
+
+    if ( Scalar::Util::blessed($action)
+        and $action->name ne "foobar" ) {
+       eval { $c->detach( 'foobar', [$action, 'foo'] ) };
+    }
+
+    $c->next::method( @_ );
+}
+
+__PACKAGE__->setup;
+
+1;