X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flive%2Flib%2FTestApp%2FController%2FAction%2FForward.pm;fp=t%2Flive%2Flib%2FTestApp%2FController%2FAction%2FForward.pm;h=b03eff9c2389e6e4793d5156b78a81dc05cf0664;hb=fbcc39ad23f2bbecf5d84c9ba581e6af86fcd460;hp=0000000000000000000000000000000000000000;hpb=21465c884872c1ec8c30acd72796445f9eaacb31;p=catagits%2FCatalyst-Runtime.git diff --git a/t/live/lib/TestApp/Controller/Action/Forward.pm b/t/live/lib/TestApp/Controller/Action/Forward.pm new file mode 100644 index 0000000..b03eff9 --- /dev/null +++ b/t/live/lib/TestApp/Controller/Action/Forward.pm @@ -0,0 +1,66 @@ +package TestApp::Controller::Action::Forward; + +use strict; +use base 'TestApp::Controller::Action'; + +sub one : Local { + my ( $self, $c ) = @_; + $c->forward('two'); +} + +sub two : Private { + my ( $self, $c ) = @_; + $c->forward('three'); +} + +sub three : Local { + my ( $self, $c ) = @_; + $c->forward('four'); +} + +sub four : Private { + my ( $self, $c ) = @_; + $c->forward('/action/forward/five'); +} + +sub five : Local { + my ( $self, $c ) = @_; + $c->forward('TestApp::View::Dump::Request'); +} + +sub jojo : Local { + my ( $self, $c ) = @_; + $c->forward('one'); + $c->forward('three'); +} + +sub inheritance : Local { + my ( $self, $c ) = @_; + $c->forward('/action/inheritance/a/b/default'); + $c->forward('five'); +} + +sub global : Local { + my ( $self, $c ) = @_; + $c->forward('/global_action'); +} + +sub with_args : Local { + my ( $self, $c, $orig ) = @_; + $c->forward( 'args', [qq/new/] ); + $c->res->body( $c->req->args->[0] ); +} + +sub with_method_and_args : Local { + my ( $self, $c, $orig ) = @_; + $c->forward( qw/TestApp::Controller::Action::Forward args/, [qq/new/] ); + $c->res->body( $c->req->args->[0] ); +} + +sub args : Local { + my ( $self, $c, $val ) = @_; + die "Expected argument 'new', got '$val'" unless $val eq 'new'; + die "passed argument does not match args" unless $val eq $c->req->args->[0]; +} + +1;