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 # Test bug found when re-adjusting the metaclass compat code in Moose
24 # in 292360. Test added to Moose in 4b760d6, but leave this attribute
25 # above ->setup so we have some generated methods to be double sure.
26 has an_attribute_before_we_change_base_classes => ( is => 'ro');
28 if ($::setup_leakchecker && eval { Class::MOP::load_class('CatalystX::LeakChecker'); 1 }) {
29 with 'CatalystX::LeakChecker';
33 default => sub { [] },
38 my ($ctx, @leaks) = @_;
39 push @{ $ctx->leaks }, @leaks;
44 return scalar @{ $ctx->leaks };
51 my $class = ref( $c->component( $_[0] ) ) || $_[0];
52 my $action = $_[1]->reverse;
56 if ( $action =~ /->(\w+)$/ ) {
59 elsif ( $action =~ /\/(\w+)$/ ) {
62 elsif ( $action =~ /^(\w+)$/ ) {
66 if ( $class && $method && $method !~ /^_/ ) {
67 my $executed = sprintf( "%s->%s", $class, $method );
68 my @executed = $c->response->headers->header('X-Catalyst-Executed');
69 push @executed, $executed;
70 $c->response->headers->header(
71 'X-Catalyst-Executed' => join ', ',
75 no warnings 'recursion';
76 return $c->SUPER::execute(@_);
79 # Replace the very large HTML error page with
80 # useful info if something crashes during a test
87 $c->res->body( 'FATAL ERROR: ' . join( ', ', @{ $c->error } ) );
91 no warnings 'redefine';
92 sub Catalyst::Log::error { }
95 # Make sure we can load Inline plugins.
97 package Catalyst::Plugin::Test::Inline;
101 use base qw/Class::Data::Inheritable/;