Fixed typo in myapp_fastcgi.pl helper
[catagits/Catalyst-Runtime.git] / t / live / lib / TestApp.pm
CommitLineData
dd4e6fd2 1package TestApp;
2
3use strict;
fbcc39ad 4use Catalyst qw/Test::Errors Test::Headers Test::Plugin/;
1408d0a4 5use Catalyst::Utils;
dd4e6fd2 6
7our $VERSION = '0.01';
8
fbcc39ad 9TestApp->config( name => 'TestApp', root => '/some/dir' );
dd4e6fd2 10
11TestApp->setup;
12
e0e47c71 13sub index : Private {
14 my ( $self, $c ) = @_;
15 $c->res->body( 'root index' );
16}
17
e5d7f18c 18sub global_action : Private {
2656a6de 19 my ( $self, $c ) = @_;
20 $c->forward('TestApp::View::Dump::Request');
21}
22
dd4e6fd2 23sub execute {
4d989a5d 24 my $c = shift;
25 my $class = ref( $c->component( $_[0] ) ) || $_[0];
fbcc39ad 26 my $action = "$_[1]";
dd4e6fd2 27
28 my $method;
29
4d989a5d 30 if ( $action =~ /->(\w+)$/ ) {
31 $method = $1;
dd4e6fd2 32 }
4d989a5d 33 elsif ( $action =~ /\/(\w+)$/ ) {
34 $method = $1;
dd4e6fd2 35 }
36
1408d0a4 37 if ( $class && $method ) {
38 my $executed = sprintf( "%s->%s", $class, $method );
fbcc39ad 39 my @executed = $c->response->headers->header('X-Catalyst-Executed');
40 push @executed, $executed;
41 $c->response->headers->header(
42 'X-Catalyst-Executed' => join ', ',
43 @executed
44 );
1408d0a4 45 }
fbcc39ad 46
dd4e6fd2 47 return $c->SUPER::execute(@_);
48}
49
501;