5 use lib "$FindBin::Bin/../lib";
9 BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
11 use Test::More tests => 21*$iters;
12 use Catalyst::Test 'TestApp';
14 if ( $ENV{CAT_BENCHMARK} ) {
16 Benchmark::timethis( $iters, \&run_tests );
27 TestApp::Controller::Action::Inheritance->begin
28 TestApp::Controller::Action::Inheritance->auto
29 TestApp::Controller::Action::Inheritance->default
30 TestApp::View::Dump::Request->process
31 TestApp::Controller::Action::Inheritance->end
34 my $expected = join( ", ", @expected );
36 ok( my $response = request('http://localhost/action/inheritance'),
38 ok( $response->is_success, 'Response Successful 2xx' );
39 is( $response->content_type, 'text/plain', 'Response Content-Type' );
40 is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' );
42 $response->header('X-Test-Class'),
43 'TestApp::Controller::Action::Inheritance',
46 is( $response->header('X-Catalyst-Executed'),
47 $expected, 'Executed actions' );
50 qr/^bless\( .* 'Catalyst::Request' \)$/s,
51 'Content is a serialized Catalyst::Request'
57 TestApp::Controller::Action::Inheritance::A->begin
58 TestApp::Controller::Action::Inheritance->auto
59 TestApp::Controller::Action::Inheritance::A->auto
60 TestApp::Controller::Action::Inheritance::A->default
61 TestApp::View::Dump::Request->process
62 TestApp::Controller::Action::Inheritance::A->end
65 my $expected = join( ", ", @expected );
67 ok( my $response = request('http://localhost/action/inheritance/a'),
69 ok( $response->is_success, 'Response Successful 2xx' );
70 is( $response->content_type, 'text/plain', 'Response Content-Type' );
71 is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' );
73 $response->header('X-Test-Class'),
74 'TestApp::Controller::Action::Inheritance::A',
77 is( $response->header('X-Catalyst-Executed'),
78 $expected, 'Executed actions' );
81 qr/^bless\( .* 'Catalyst::Request' \)$/s,
82 'Content is a serialized Catalyst::Request'
88 TestApp::Controller::Action::Inheritance::A::B->begin
89 TestApp::Controller::Action::Inheritance->auto
90 TestApp::Controller::Action::Inheritance::A->auto
91 TestApp::Controller::Action::Inheritance::A::B->auto
92 TestApp::Controller::Action::Inheritance::A::B->default
93 TestApp::View::Dump::Request->process
94 TestApp::Controller::Action::Inheritance::A::B->end
97 my $expected = join( ", ", @expected );
99 ok( my $response = request('http://localhost/action/inheritance/a/b'),
101 ok( $response->is_success, 'Response Successful 2xx' );
102 is( $response->content_type, 'text/plain', 'Response Content-Type' );
103 is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' );
105 $response->header('X-Test-Class'),
106 'TestApp::Controller::Action::Inheritance::A::B',
109 is( $response->header('X-Catalyst-Executed'),
110 $expected, 'Executed actions' );
113 qr/^bless\( .* 'Catalyst::Request' \)$/s,
114 'Content is a serialized Catalyst::Request'