tests and patch for Controller to accept action_args from constructor
[catagits/Catalyst-Runtime.git] / t / lib / TestApp / Controller / Action / Action.pm
index 787bb8d..515fb2a 100644 (file)
@@ -3,6 +3,18 @@ package TestApp::Controller::Action::Action;
 use strict;
 use base 'TestApp::Controller::Action';
 
+__PACKAGE__->config(
+    actions => {
+        '*'                 => { extra_attribute  => 13 },
+        action_action_five  => { ActionClass => '+Catalyst::Action::TestBefore' },
+        action_action_eight => { another_extra_attribute => 'foo' },
+    },
+    action_args => {
+        '*'                 => { extra_arg         => 42 },
+        action_action_seven => { another_extra_arg => 23 },
+    },
+);
+
 sub action_action_one : Global : ActionClass('TestBefore') {
     my ( $self, $c ) = @_;
     $c->res->header( 'X-Action', $c->stash->{test} );
@@ -25,4 +37,29 @@ sub action_action_four : Global : MyAction('TestMyAction') {
     $c->forward('TestApp::View::Dump::Request');
 }
 
+sub action_action_five : Global {
+    my ( $self, $c ) = @_;
+    $c->res->header( 'X-Action', $c->stash->{test} );
+    $c->forward('TestApp::View::Dump::Request');
+}
+
+sub action_action_six : Global : ActionClass('~TestMyAction') {
+    my ( $self, $c ) = @_;
+    $c->forward('TestApp::View::Dump::Request');
+}
+
+sub action_action_seven : Global : ActionClass('~TestExtraArgsAction') {
+    my ( $self, $c ) = @_;
+    $c->forward('TestApp::View::Dump::Request');
+}
+
+sub action_action_eight : Global  {
+    my ( $self, $c ) = @_;
+    $c->forward('TestApp::View::Dump::Action');
+}
+
+sub action_action_nine : Global : ActionClass('~TestActionArgsFromConstructor') {
+    my ( $self, $c ) = @_;
+    $c->forward('TestApp::View::Dump::Request');
+}
 1;