1 package TestApp::Context;
3 extends 'Catalyst::Context';
4 with 'Catalyst::TraitFor::Context::TestHeaders';
6 if (eval { Class::MOP::load_class('CatalystX::LeakChecker'); 1 }) {
7 with 'CatalystX::LeakChecker';
11 default => sub { [] },
16 my ($ctx, @leaks) = @_;
17 push @{ $ctx->leaks }, @leaks;
22 return scalar @{ $ctx->leaks };
27 my $class = ref( $c->component( $_[0] ) ) || $_[0];
28 my $action = $_[1]->reverse;
32 if ( $action =~ /->(\w+)$/ ) {
35 elsif ( $action =~ /\/(\w+)$/ ) {
38 elsif ( $action =~ /^(\w+)$/ ) {
42 if ( $class && $method && $method !~ /^_/ ) {
43 my $executed = sprintf( "%s->%s", $class, $method );
44 my @executed = $c->response->headers->header('X-Catalyst-Executed');
45 push @executed, $executed;
46 $c->response->headers->header(
47 'X-Catalyst-Executed' => join ', ',
51 no warnings 'recursion';
52 return $c->SUPER::execute(@_);