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 # Test bug found when re-adjusting the metaclass compat code in Moose
48 # in 292360. Test added to Moose in 4b760d6, but leave this attribute
49 # above ->setup so we have some generated methods to be double sure.
50 has an_attribute_before_we_change_base_classes => ( is => 'ro');
52 if ($::setup_leakchecker && eval { Class::MOP::load_class('CatalystX::LeakChecker'); 1 }) {
53 with 'CatalystX::LeakChecker';
57 default => sub { [] },
62 my ($ctx, @leaks) = @_;
63 push @{ $ctx->leaks }, @leaks;
68 return scalar @{ $ctx->leaks };
75 my $class = ref( $c->component( $_[0] ) ) || $_[0];
76 my $action = $_[1]->reverse;
80 if ( $action =~ /->(\w+)$/ ) {
83 elsif ( $action =~ /\/(\w+)$/ ) {
86 elsif ( $action =~ /^(\w+)$/ ) {
90 if ( $class && $method && $method !~ /^_/ ) {
91 my $executed = sprintf( "%s->%s", $class, $method );
92 my @executed = $c->response->headers->header('X-Catalyst-Executed');
93 push @executed, $executed;
94 $c->response->headers->header(
95 'X-Catalyst-Executed' => join ', ',
99 no warnings 'recursion';
100 return $c->SUPER::execute(@_);
103 # Replace the very large HTML error page with
104 # useful info if something crashes during a test
108 $c->next::method(@_);
110 $c->res->status(500);
111 $c->res->body( 'FATAL ERROR: ' . join( ', ', @{ $c->error } ) );
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/;