9 +TestApp::Plugin::FullyQualified
10 +TestApp::Plugin::AddDispatchTypes
14 our $VERSION = '0.01';
16 TestApp->config( name => 'TestApp', root => '/some/dir' );
21 my ( $self, $c ) = @_;
22 $c->res->body('root index');
25 sub global_action : Private {
26 my ( $self, $c ) = @_;
27 $c->forward('TestApp::View::Dump::Request');
32 my $class = ref( $c->component( $_[0] ) ) || $_[0];
33 my $action = $_[1]->reverse;
37 if ( $action =~ /->(\w+)$/ ) {
40 elsif ( $action =~ /\/(\w+)$/ ) {
43 elsif ( $action =~ /^(\w+)$/ ) {
47 if ( $class && $method && $method !~ /^_/ ) {
48 my $executed = sprintf( "%s->%s", $class, $method );
49 my @executed = $c->response->headers->header('X-Catalyst-Executed');
50 push @executed, $executed;
51 $c->response->headers->header(
52 'X-Catalyst-Executed' => join ', ',
57 return $c->SUPER::execute(@_);
60 # Replace the very large HTML error page with
61 # useful info if something crashes during a test
68 $c->res->body( 'FATAL ERROR: ' . join( ', ', @{ $c->error } ) );
71 sub class_forward_test_method :Private {
72 my ( $self, $c ) = @_;
73 $c->response->headers->header( 'X-Class-Forward-Test-Method' => 1 );
76 sub class_go_test_method :Private {
77 my ( $self, $c ) = @_;
78 $c->response->headers->header( 'X-Class-Go-Test-Method' => 1 );
81 sub class_visit_test_method :Private {
82 my ( $self, $c ) = @_;
83 $c->response->headers->header( 'X-Class-Visit-Test-Method' => 1 );
86 sub loop_test : Local {
87 my ( $self, $c ) = @_;
90 $c->forward( 'class_forward_test_method' );
94 sub recursion_test : Local {
95 my ( $self, $c ) = @_;
96 $c->forward( 'recursion_test' );
100 no warnings 'redefine';
101 sub Catalyst::Log::error { }
104 # Make sure we can load Inline plugins.
106 package Catalyst::Plugin::Test::Inline;
110 use base qw/Catalyst::Base Class::Data::Inheritable/;