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 };
46 my $class = ref( $c->component( $_[0] ) ) || $_[0];
47 my $action = $_[1]->reverse;
51 if ( $action =~ /->(\w+)$/ ) {
54 elsif ( $action =~ /\/(\w+)$/ ) {
57 elsif ( $action =~ /^(\w+)$/ ) {
61 if ( $class && $method && $method !~ /^_/ ) {
62 my $executed = sprintf( "%s->%s", $class, $method );
63 my @executed = $c->response->headers->header('X-Catalyst-Executed');
64 push @executed, $executed;
65 $c->response->headers->header(
66 'X-Catalyst-Executed' => join ', ',
70 no warnings 'recursion';
71 return $c->SUPER::execute(@_);
74 # Replace the very large HTML error page with
75 # useful info if something crashes during a test
82 $c->res->body( 'FATAL ERROR: ' . join( ', ', @{ $c->error } ) );
86 no warnings 'redefine';
87 sub Catalyst::Log::error { }
90 # Make sure we can load Inline plugins.
92 package Catalyst::Plugin::Test::Inline;
96 use base qw/Class::Data::Inheritable/;