5 Test::MangleDollarUnderScore
10 +TestApp::Plugin::FullyQualified
11 +TestApp::Plugin::AddDispatchTypes
17 use namespace::autoclean;
19 our $VERSION = '0.01';
21 TestApp->config( name => 'TestApp', root => '/some/dir' );
23 if (eval { Class::MOP::load_class('CatalystX::LeakChecker'); 1 }) {
24 with 'CatalystX::LeakChecker';
28 default => sub { [] },
33 my ($ctx, @leaks) = @_;
34 push @{ $ctx->leaks }, @leaks;
39 return scalar @{ $ctx->leaks };
45 my ( $self, $c ) = @_;
46 $c->res->body('root index');
49 sub global_action : Private {
50 my ( $self, $c ) = @_;
51 $c->forward('TestApp::View::Dump::Request');
56 my $class = ref( $c->component( $_[0] ) ) || $_[0];
57 my $action = $_[1]->reverse;
61 if ( $action =~ /->(\w+)$/ ) {
64 elsif ( $action =~ /\/(\w+)$/ ) {
67 elsif ( $action =~ /^(\w+)$/ ) {
71 if ( $class && $method && $method !~ /^_/ ) {
72 my $executed = sprintf( "%s->%s", $class, $method );
73 my @executed = $c->response->headers->header('X-Catalyst-Executed');
74 push @executed, $executed;
75 $c->response->headers->header(
76 'X-Catalyst-Executed' => join ', ',
80 no warnings 'recursion';
81 return $c->SUPER::execute(@_);
84 # Replace the very large HTML error page with
85 # useful info if something crashes during a test
92 $c->res->body( 'FATAL ERROR: ' . join( ', ', @{ $c->error } ) );
95 sub class_forward_test_method :Private {
96 my ( $self, $c ) = @_;
97 $c->response->headers->header( 'X-Class-Forward-Test-Method' => 1 );
100 sub loop_test : Local {
101 my ( $self, $c ) = @_;
104 $c->forward( 'class_forward_test_method' );
108 sub recursion_test : Local {
109 my ( $self, $c ) = @_;
110 no warnings 'recursion';
111 $c->forward( 'recursion_test' );
115 no warnings 'redefine';
116 sub Catalyst::Log::error { }
119 # Make sure we can load Inline plugins.
121 package Catalyst::Plugin::Test::Inline;
125 use base qw/Class::Data::Inheritable/;