X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FTestApp%2FController%2FRoot.pm;h=ce3ee757de9a07f79b8a3ebcc83021356204f89d;hb=2688734f3a611b95e5c1f82c0c248c462d1eaa6b;hp=afdf6db853a0aa79dfaf460179b4daa0be6a0e1b;hpb=a202886b47ea577ff9e29c18214a7c02cfd8b9e3;p=catagits%2FCatalyst-Runtime.git diff --git a/t/lib/TestApp/Controller/Root.pm b/t/lib/TestApp/Controller/Root.pm index afdf6db..ce3ee75 100644 --- a/t/lib/TestApp/Controller/Root.pm +++ b/t/lib/TestApp/Controller/Root.pm @@ -1,5 +1,6 @@ package TestApp::Controller::Root; - +use strict; +use warnings; use base 'Catalyst::Controller'; __PACKAGE__->config->{namespace} = ''; @@ -13,6 +14,16 @@ sub zero : Path('0') { $c->forward('TestApp::View::Dump::Request'); } +sub zerobody : Local { + my ($self, $c) = @_; + $c->res->body('0'); +} + +sub emptybody : Local { + my ($self, $c) = @_; + $c->res->body(''); +} + sub localregex : LocalRegex('^localregex$') { my ( $self, $c ) = @_; $c->res->header( 'X-Test-Class' => ref($self) ); @@ -48,4 +59,31 @@ sub recursion_test : Local { $c->forward( 'recursion_test' ); } +sub base_href_test : Local { + my ( $self, $c ) = @_; + + my $body = <<"EndOfBody"; + + + + + + + +EndOfBody + + $c->response->body($body); +} + +sub body_semipredicate : Local { + my ($self, $c) = @_; + $c->res->body; # Old code tests length($c->res->body), which causes the value to be built (undef), which causes the predicate + $c->res->status( $c->res->has_body ? 500 : 200 ); # to return the wrong thing, resulting in a 500. + $c->res->body('Body'); +} + +sub end : Private { + my ($self,$c) = @_; +} + 1;