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';
48 use_request_uri_for_path => 1,
49 'Controller::Action::Action' => {
51 action_action_nine => { another_extra_arg => 13 }
56 # Test bug found when re-adjusting the metaclass compat code in Moose
57 # in 292360. Test added to Moose in 4b760d6, but leave this attribute
58 # above ->setup so we have some generated methods to be double sure.
59 has an_attribute_before_we_change_base_classes => ( is => 'ro');
61 if ($::setup_leakchecker && eval { Class::MOP::load_class('CatalystX::LeakChecker'); 1 }) {
62 with 'CatalystX::LeakChecker';
66 default => sub { [] },
71 my ($ctx, @leaks) = @_;
72 push @{ $ctx->leaks }, @leaks;
77 return scalar @{ $ctx->leaks };
84 my $class = ref( $c->component( $_[0] ) ) || $_[0];
85 my $action = $_[1]->reverse;
89 if ( $action =~ /->(\w+)$/ ) {
92 elsif ( $action =~ /\/(\w+)$/ ) {
95 elsif ( $action =~ /^(\w+)$/ ) {
99 if ( $class && $method && $method !~ /^_/ ) {
100 my $executed = sprintf( "%s->%s", $class, $method );
101 my @executed = $c->response->headers->header('X-Catalyst-Executed');
102 push @executed, $executed;
103 $c->response->headers->header(
104 'X-Catalyst-Executed' => join ', ',
108 no warnings 'recursion';
109 return $c->SUPER::execute(@_);
112 # Replace the very large HTML error page with
113 # useful info if something crashes during a test
117 $c->next::method(@_);
119 $c->res->status(500);
120 $c->res->body( 'FATAL ERROR: ' . join( ', ', @{ $c->error } ) );
124 no warnings 'redefine';
125 sub Catalyst::Log::error { }
128 # Pretend to be Plugin::Session and hook finalize_headers to send a header
130 sub finalize_headers {
133 $c->res->header('X-Test-Header', 'valid');
135 return $c->maybe::next::method(@_);
138 # Make sure we can load Inline plugins.
140 package Catalyst::Plugin::Test::Inline;
144 use base qw/Class::Data::Inheritable/;