5 Test::MangleDollarUnderScore
10 +TestApp::Plugin::FullyQualified
11 +TestApp::Plugin::AddDispatchTypes
17 use namespace::autoclean;
20 # t/aggregate/unit_core_ctx_attr.t pukes until lazy is true
23 sub hello_notlazy { 'hello there' }
24 sub hello_lazy { 'hello there' }
27 has 'my_greeting_obj_notlazy' => (
30 default => sub { Greeting->new() },
31 handles => [ qw( hello_notlazy ) ],
34 has 'my_greeting_obj_lazy' => (
37 default => sub { Greeting->new() },
38 handles => [ qw( hello_lazy ) ],
43 our $VERSION = '0.01';
45 TestApp->config( name => 'TestApp', root => '/some/dir', use_request_uri_for_path => 1 );
47 if ($::setup_leakchecker && eval { Class::MOP::load_class('CatalystX::LeakChecker'); 1 }) {
48 with 'CatalystX::LeakChecker';
52 default => sub { [] },
57 my ($ctx, @leaks) = @_;
58 push @{ $ctx->leaks }, @leaks;
63 return scalar @{ $ctx->leaks };
70 my $class = ref( $c->component( $_[0] ) ) || $_[0];
71 my $action = $_[1]->reverse;
75 if ( $action =~ /->(\w+)$/ ) {
78 elsif ( $action =~ /\/(\w+)$/ ) {
81 elsif ( $action =~ /^(\w+)$/ ) {
85 if ( $class && $method && $method !~ /^_/ ) {
86 my $executed = sprintf( "%s->%s", $class, $method );
87 my @executed = $c->response->headers->header('X-Catalyst-Executed');
88 push @executed, $executed;
89 $c->response->headers->header(
90 'X-Catalyst-Executed' => join ', ',
94 no warnings 'recursion';
95 return $c->SUPER::execute(@_);
98 # Replace the very large HTML error page with
99 # useful info if something crashes during a test
103 $c->next::method(@_);
105 $c->res->status(500);
106 $c->res->body( 'FATAL ERROR: ' . join( ', ', @{ $c->error } ) );
110 no warnings 'redefine';
111 sub Catalyst::Log::error { }
114 # Make sure we can load Inline plugins.
116 package Catalyst::Plugin::Test::Inline;
120 use base qw/Class::Data::Inheritable/;