7 use lib "$FindBin::Bin/../../../lib";
9 use Test::More tests =>21;
10 use Catalyst::Test 'TestApp';
15 TestApp::Controller::Action::Inheritance->begin
16 TestApp::Controller::Action::Inheritance->auto
17 TestApp::Controller::Action::Inheritance->default
18 TestApp::View::Dump::Request->process
19 TestApp::Controller::Action::Inheritance->end
22 my $expected = join( ", ", @expected );
24 ok( my $response = request('http://localhost/action/inheritance'), 'Request' );
25 ok( $response->is_success, 'Response Successful 2xx' );
26 is( $response->content_type, 'text/plain', 'Response Content-Type' );
27 is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' );
28 is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Inheritance', 'Test Class' );
29 is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' );
30 like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
35 TestApp::Controller::Action::Inheritance::A->begin
36 TestApp::Controller::Action::Inheritance->auto
37 TestApp::Controller::Action::Inheritance::A->auto
38 TestApp::Controller::Action::Inheritance::A->default
39 TestApp::View::Dump::Request->process
40 TestApp::Controller::Action::Inheritance::A->end
43 my $expected = join( ", ", @expected );
45 ok( my $response = request('http://localhost/action/inheritance/a'), 'Request' );
46 ok( $response->is_success, 'Response Successful 2xx' );
47 is( $response->content_type, 'text/plain', 'Response Content-Type' );
48 is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' );
49 is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Inheritance::A', 'Test Class' );
50 is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' );
51 like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
56 TestApp::Controller::Action::Inheritance::A::B->begin
57 TestApp::Controller::Action::Inheritance->auto
58 TestApp::Controller::Action::Inheritance::A->auto
59 TestApp::Controller::Action::Inheritance::A::B->auto
60 TestApp::Controller::Action::Inheritance::A::B->default
61 TestApp::View::Dump::Request->process
62 TestApp::Controller::Action::Inheritance::A::B->end
65 my $expected = join( ", ", @expected );
67 ok( my $response = request('http://localhost/action/inheritance/a/b'), 'Request' );
68 ok( $response->is_success, 'Response Successful 2xx' );
69 is( $response->content_type, 'text/plain', 'Response Content-Type' );
70 is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' );
71 is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Inheritance::A::B', 'Test Class' );
72 is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' );
73 like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );