X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FTestApp%2FController%2FRoot.pm;h=58952230e722b0a737565eb97700690603076ab8;hb=8eab1a1ad6c18c13fc29292e7201bc658849532e;hp=53d79e2bacbe55924651301f5e3f1e7df5b1cae8;hpb=19c01ee1613eadba41675cdb0707645d780df03d;p=catagits%2FCatalyst-Runtime.git diff --git a/t/lib/TestApp/Controller/Root.pm b/t/lib/TestApp/Controller/Root.pm index 53d79e2..5895223 100644 --- a/t/lib/TestApp/Controller/Root.pm +++ b/t/lib/TestApp/Controller/Root.pm @@ -1,6 +1,8 @@ package TestApp::Controller::Root; - +use strict; +use warnings; use base 'Catalyst::Controller'; +use utf8; __PACKAGE__->config->{namespace} = ''; @@ -13,11 +15,107 @@ sub zero : Path('0') { $c->forward('TestApp::View::Dump::Request'); } -sub localregex : LocalRegex('^localregex$') { +sub zerobody : Local { + my ($self, $c) = @_; + $c->res->body('0'); +} + +sub emptybody : Local { + my ($self, $c) = @_; + $c->res->body(''); +} + +sub index : Private { + my ( $self, $c ) = @_; + $c->res->body('root index'); +} + +sub global_action : Private { my ( $self, $c ) = @_; - $c->res->header( 'X-Test-Class' => ref($self) ); - $c->response->content_type('text/plain; charset=utf-8'); $c->forward('TestApp::View::Dump::Request'); } +sub class_forward_test_method :Private { + my ( $self, $c ) = @_; + $c->response->headers->header( 'X-Class-Forward-Test-Method' => 1 ); +} + +sub loop_test : Local { + my ( $self, $c ) = @_; + + for( 1..1001 ) { + $c->forward( 'class_forward_test_method' ); + } +} + +sub recursion_test : Local { + my ( $self, $c ) = @_; + no warnings 'recursion'; + $c->forward( 'recursion_test' ); +} + +sub base_href_test : Local { + my ( $self, $c ) = @_; + + my $body = <<"EndOfBody"; + +
+