X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Flib%2FTestApp%2FController%2FAction%2FForward.pm;h=4fdf5eada4b3312cb0ff27e34350efe5c16e8654;hp=1d65d149f4a670c2ca35f906caf9e73e0770af08;hb=a1dad9c1cde458c1b9429ceca83691607b1ee9c2;hpb=b114f90888d21c4a82cfc4dde4df8396af0ac6d2 diff --git a/t/lib/TestApp/Controller/Action/Forward.pm b/t/lib/TestApp/Controller/Action/Forward.pm index 1d65d14..4fdf5ea 100644 --- a/t/lib/TestApp/Controller/Action/Forward.pm +++ b/t/lib/TestApp/Controller/Action/Forward.pm @@ -3,7 +3,7 @@ package TestApp::Controller::Action::Forward; use strict; use base 'TestApp::Controller::Action'; -sub one : Relative { +sub one : Local { my ( $self, $c ) = @_; $c->forward('two'); } @@ -13,7 +13,7 @@ sub two : Private { $c->forward('three'); } -sub three : Relative { +sub three : Local { my ( $self, $c ) = @_; $c->forward('four'); } @@ -23,29 +23,46 @@ sub four : Private { $c->forward('/action/forward/five'); } -sub five : Relative { +sub five : Local { my ( $self, $c ) = @_; $c->forward('TestApp::View::Dump::Request'); } -sub jojo : Relative { +sub jojo : Local { my ( $self, $c ) = @_; $c->forward('one'); $c->forward('three'); } -sub inheritance : Relative { +sub inheritance : Local { my ( $self, $c ) = @_; $c->forward('/action/inheritance/a/b/default'); $c->forward('five'); } -sub global : Relative { +sub global : Local { my ( $self, $c ) = @_; - $c->forward('/global_action'); + $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;