9 +TestApp::Plugin::FullyQualified
13 our $VERSION = '0.01';
15 TestApp->config( name => 'TestApp', root => '/some/dir' );
17 unless (eval 'require Moose; 1') {
18 TestApp->config(setup_components => { except => 'TestApp::Controller::Moose' });
24 my ( $self, $c ) = @_;
25 $c->res->body('root index');
28 sub global_action : Private {
29 my ( $self, $c ) = @_;
30 $c->forward('TestApp::View::Dump::Request');
35 my $class = ref( $c->component( $_[0] ) ) || $_[0];
40 if ( $action =~ /->(\w+)$/ ) {
43 elsif ( $action =~ /\/(\w+)$/ ) {
46 elsif ( $action =~ /^(\w+)$/ ) {
50 if ( $class && $method && $method !~ /^_/ ) {
51 my $executed = sprintf( "%s->%s", $class, $method );
52 my @executed = $c->response->headers->header('X-Catalyst-Executed');
53 push @executed, $executed;
54 $c->response->headers->header(
55 'X-Catalyst-Executed' => join ', ',
60 return $c->SUPER::execute(@_);
63 # Replace the very large HTML error page with
64 # useful info if something crashes during a test
68 $c->NEXT::finalize_error(@_);
71 $c->res->body( 'FATAL ERROR: ' . join( ', ', @{ $c->error } ) );
74 sub class_forward_test_method :Private {
75 my ( $self, $c ) = @_;
76 $c->response->headers->header( 'X-Class-Forward-Test-Method' => 1 );
79 sub class_go_test_method :Private {
80 my ( $self, $c ) = @_;
81 $c->response->headers->header( 'X-Class-Go-Test-Method' => 1 );
84 sub class_visit_test_method :Private {
85 my ( $self, $c ) = @_;
86 $c->response->headers->header( 'X-Class-Visit-Test-Method' => 1 );
89 sub loop_test : Local {
90 my ( $self, $c ) = @_;
93 $c->forward( 'class_forward_test_method' );
97 sub recursion_test : Local {
98 my ( $self, $c ) = @_;
99 $c->forward( 'recursion_test' );
103 no warnings 'redefine';
104 sub Catalyst::Log::error { }
107 # Make sure we can load Inline plugins.
109 package Catalyst::Plugin::Test::Inline;
113 use base qw/Catalyst::Base Class::Data::Inheritable/;