9 +TestApp::Plugin::FullyQualified
10 +TestApp::Plugin::AddDispatchTypes
15 our $VERSION = '0.01';
17 TestApp->config( name => 'TestApp', root => '/some/dir' );
22 my ( $self, $c ) = @_;
23 $c->res->body('root index');
26 sub global_action : Private {
27 my ( $self, $c ) = @_;
28 $c->forward('TestApp::View::Dump::Request');
33 my $class = ref( $c->component( $_[0] ) ) || $_[0];
34 my $action = $_[1]->reverse;
38 if ( $action =~ /->(\w+)$/ ) {
41 elsif ( $action =~ /\/(\w+)$/ ) {
44 elsif ( $action =~ /^(\w+)$/ ) {
48 if ( $class && $method && $method !~ /^_/ ) {
49 my $executed = sprintf( "%s->%s", $class, $method );
50 my @executed = $c->response->headers->header('X-Catalyst-Executed');
51 push @executed, $executed;
52 $c->response->headers->header(
53 'X-Catalyst-Executed' => join ', ',
58 return $c->SUPER::execute(@_);
61 # Replace the very large HTML error page with
62 # useful info if something crashes during a test
69 $c->res->body( 'FATAL ERROR: ' . join( ', ', @{ $c->error } ) );
72 sub class_forward_test_method :Private {
73 my ( $self, $c ) = @_;
74 $c->response->headers->header( 'X-Class-Forward-Test-Method' => 1 );
77 sub loop_test : Local {
78 my ( $self, $c ) = @_;
81 $c->forward( 'class_forward_test_method' );
85 sub recursion_test : Local {
86 my ( $self, $c ) = @_;
87 $c->forward( 'recursion_test' );
91 no warnings 'redefine';
92 sub Catalyst::Log::error { }
95 # Make sure we can load Inline plugins.
97 package Catalyst::Plugin::Test::Inline;
101 use base qw/Class::Data::Inheritable/;