4 Test::MangleDollarUnderScore
9 +TestApp::Plugin::FullyQualified
10 +TestApp::Plugin::AddDispatchTypes
16 use namespace::autoclean;
19 # t/aggregate/unit_core_ctx_attr.t pukes until lazy is true
22 sub hello_notlazy { 'hello there' }
23 sub hello_lazy { 'hello there' }
26 has 'my_greeting_obj_notlazy' => (
29 default => sub { Greeting->new() },
30 handles => [ qw( hello_notlazy ) ],
33 has 'my_greeting_obj_lazy' => (
36 default => sub { Greeting->new() },
37 handles => [ qw( hello_lazy ) ],
42 our $VERSION = '0.01';
47 use_request_uri_for_path => 1,
48 'Controller::Action::Action' => {
50 action_action_nine => { another_extra_arg => 13 }
54 abort_chain_on_error_fix => 1,
57 # Test bug found when re-adjusting the metaclass compat code in Moose
58 # in 292360. Test added to Moose in 4b760d6, but leave this attribute
59 # above ->setup so we have some generated methods to be double sure.
60 has an_attribute_before_we_change_base_classes => ( is => 'ro');
62 if ($::setup_leakchecker && eval { Class::MOP::load_class('CatalystX::LeakChecker'); 1 }) {
63 with 'CatalystX::LeakChecker';
67 default => sub { [] },
72 my ($ctx, @leaks) = @_;
73 push @{ $ctx->leaks }, @leaks;
78 return scalar @{ $ctx->leaks };
85 my $class = ref( $c->component( $_[0] ) ) || $_[0];
86 my $action = $_[1]->reverse;
90 if ( $action =~ /->(\w+)$/ ) {
93 elsif ( $action =~ /\/(\w+)$/ ) {
96 elsif ( $action =~ /^(\w+)$/ ) {
100 if ( $class && $method && $method !~ /^_/ ) {
101 my $executed = sprintf( "%s->%s", $class, $method );
102 my @executed = $c->response->headers->header('X-Catalyst-Executed');
103 push @executed, $executed;
104 $c->response->headers->header(
105 'X-Catalyst-Executed' => join ', ',
109 no warnings 'recursion';
110 return $c->SUPER::execute(@_);
113 # Replace the very large HTML error page with
114 # useful info if something crashes during a test
118 $c->next::method(@_);
120 $c->res->status(500);
121 $c->res->body( 'FATAL ERROR: ' . join( ', ', @{ $c->error } ) );
125 no warnings 'redefine';
126 sub Catalyst::Log::error { }
129 # Pretend to be Plugin::Session and hook finalize_headers to send a header
131 sub finalize_headers {
134 $c->res->header('X-Test-Header', 'valid');
136 my $call_count = $c->stash->{finalize_headers_call_count} || 0;
138 $c->stash(finalize_headers_call_count => $call_count);
139 $c->res->header('X-Test-Header-Call-Count' => $call_count);
141 return $c->maybe::next::method(@_);
144 # Make sure we can load Inline plugins.
146 package Catalyst::Plugin::Test::Inline;
150 use base qw/Class::Data::Inheritable/;