use FindBin;
use lib "$FindBin::Bin/../../../lib";
-use Test::More tests => 7;
+use Test::More tests => 70;
use Catalyst::Test 'TestApp';
-{
- my @expected = qw[
- TestApp::Controller::Action::Begin->begin
- TestApp::Controller::Action::Begin->default
- TestApp::View::Dump::Request->process
- ];
+for ( 1 .. 10 ) {
+ {
+ my @expected = qw[
+ TestApp::Controller::Action::Begin->begin
+ TestApp::Controller::Action::Begin->default
+ TestApp::View::Dump::Request->process
+ ];
- my $expected = join( ", ", @expected );
+ my $expected = join( ", ", @expected );
- ok( my $response = request('http://localhost/action/begin'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' );
- is(
- $response->header('X-Test-Class'),
- 'TestApp::Controller::Action::Begin',
- 'Test Class'
- );
- is( $response->header('X-Catalyst-Executed'),
- $expected, 'Executed actions' );
- like( $response->content, qr/'Catalyst::Request'/,
- 'Content is a serialized Catalyst::Request' );
+ ok( my $response = request('http://localhost/action/begin'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Begin',
+ 'Test Class'
+ );
+ is( $response->header('X-Catalyst-Executed'),
+ $expected, 'Executed actions' );
+ like( $response->content, qr/'Catalyst::Request'/,
+ 'Content is a serialized Catalyst::Request' );
+ }
}
use FindBin;
use lib "$FindBin::Bin/../../../lib";
-use Test::More tests=>9 ;
+use Test::More tests => 90;
use Catalyst::Test 'TestApp';
-
-{
- my @expected = qw[
- TestApp::Controller::Action::Default->begin
- TestApp::Controller::Action::Default->default
- TestApp::View::Dump::Request->process
- ];
-
- my $expected = join( ", ", @expected );
-
- ok( my $response = request('http://localhost/action/default'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Default', 'Test Class' );
- is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' );
- like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
-
- ok( $response = request('http://localhost/foo/bar/action'), 'Request' );
- is( $response->code, 404, 'Invalid URI returned 404' );
+for ( 1 .. 10 ) {
+ {
+ my @expected = qw[
+ TestApp::Controller::Action::Default->begin
+ TestApp::Controller::Action::Default->default
+ TestApp::View::Dump::Request->process
+ ];
+
+ my $expected = join( ", ", @expected );
+
+ ok( my $response = request('http://localhost/action/default'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Default',
+ 'Test Class'
+ );
+ is( $response->header('X-Catalyst-Executed'),
+ $expected, 'Executed actions' );
+ like(
+ $response->content,
+ qr/^bless\( .* 'Catalyst::Request' \)$/s,
+ 'Content is a serialized Catalyst::Request'
+ );
+
+ ok( $response = request('http://localhost/foo/bar/action'), 'Request' );
+ is( $response->code, 404, 'Invalid URI returned 404' );
+ }
}
use FindBin;\r
use lib "$FindBin::Bin/../../../lib";\r
\r
-use Test::More tests => 18;\r
+use Test::More tests => 180;\r
use Catalyst::Test 'TestApp';\r
\r
+for ( 1 .. 10 ) {\r
+ {\r
+ my @expected = qw[\r
+ TestApp::Controller::Action::Detach->begin\r
+ TestApp::Controller::Action::Detach->one\r
+ TestApp::Controller::Action::Detach->two\r
+ TestApp::View::Dump::Request->process\r
+ ];\r
\r
-{\r
- my @expected = qw[\r
- TestApp::Controller::Action::Detach->begin\r
- TestApp::Controller::Action::Detach->one\r
- TestApp::Controller::Action::Detach->two\r
- TestApp::View::Dump::Request->process\r
- ];\r
+ my $expected = join( ", ", @expected );\r
\r
- my $expected = join( ", ", @expected );\r
+ # Test detach to chain of actions.\r
+ ok( my $response = request('http://localhost/action/detach/one'),\r
+ 'Request' );\r
+ ok( $response->is_success, 'Response Successful 2xx' );\r
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );\r
+ is( $response->header('X-Catalyst-Action'),\r
+ 'action/detach/one', 'Test Action' );\r
+ is(\r
+ $response->header('X-Test-Class'),\r
+ 'TestApp::Controller::Action::Detach',\r
+ 'Test Class'\r
+ );\r
+ is( $response->header('X-Catalyst-Executed'),\r
+ $expected, 'Executed actions' );\r
+ }\r
\r
- # Test detach to chain of actions.\r
- ok( my $response = request('http://localhost/action/detach/one'), 'Request' );\r
- ok( $response->is_success, 'Response Successful 2xx' );\r
- is( $response->content_type, 'text/plain', 'Response Content-Type' );\r
- is( $response->header('X-Catalyst-Action'), 'action/detach/one', 'Test Action' );\r
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Detach', 'Test Class' );\r
- is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' );\r
-}\r
+ {\r
+ my @expected = qw[\r
+ TestApp::Controller::Action::Detach->begin\r
+ TestApp::Controller::Action::Detach->path\r
+ TestApp::Controller::Action::Detach->two\r
+ TestApp::View::Dump::Request->process\r
+ ];\r
\r
-{\r
- my @expected = qw[\r
- TestApp::Controller::Action::Detach->begin\r
- TestApp::Controller::Action::Detach->path\r
- TestApp::Controller::Action::Detach->two\r
- TestApp::View::Dump::Request->process\r
- ];\r
-\r
- my $expected = join( ", ", @expected );\r
-\r
- # Test detach to chain of actions.\r
- ok( my $response = request('http://localhost/action/detach/path'), 'Request' );\r
- ok( $response->is_success, 'Response Successful 2xx' );\r
- is( $response->content_type, 'text/plain', 'Response Content-Type' );\r
- is( $response->header('X-Catalyst-Action'), 'action/detach/path', 'Test Action' );\r
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Detach', 'Test Class' );\r
- is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' );\r
-}\r
+ my $expected = join( ", ", @expected );\r
\r
-{\r
- ok( my $response = request('http://localhost/action/detach/with_args/old'), 'Request with args' );\r
- ok( $response->is_success, 'Response Successful 2xx' );\r
- is( $response->content, 'new');\r
-}\r
+ # Test detach to chain of actions.\r
+ ok( my $response = request('http://localhost/action/detach/path'),\r
+ 'Request' );\r
+ ok( $response->is_success, 'Response Successful 2xx' );\r
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );\r
+ is( $response->header('X-Catalyst-Action'),\r
+ 'action/detach/path', 'Test Action' );\r
+ is(\r
+ $response->header('X-Test-Class'),\r
+ 'TestApp::Controller::Action::Detach',\r
+ 'Test Class'\r
+ );\r
+ is( $response->header('X-Catalyst-Executed'),\r
+ $expected, 'Executed actions' );\r
+ }\r
+\r
+ {\r
+ ok(\r
+ my $response =\r
+ request('http://localhost/action/detach/with_args/old'),\r
+ 'Request with args'\r
+ );\r
+ ok( $response->is_success, 'Response Successful 2xx' );\r
+ is( $response->content, 'new' );\r
+ }\r
\r
-{\r
- ok( my $response = request('http://localhost/action/detach/with_method_and_args/old'), 'Request with args and method' );\r
- ok( $response->is_success, 'Response Successful 2xx' );\r
- is( $response->content, 'new');\r
+ {\r
+ ok(\r
+ my $response = request(\r
+ 'http://localhost/action/detach/with_method_and_args/old'),\r
+ 'Request with args and method'\r
+ );\r
+ ok( $response->is_success, 'Response Successful 2xx' );\r
+ is( $response->content, 'new' );\r
+ }\r
}\r
use FindBin;
use lib "$FindBin::Bin/../../../lib";
-use Test::More tests => 7;
+use Test::More tests => 70;
use Catalyst::Test 'TestApp';
+for ( 1 .. 10 ) {
+ {
+ my @expected = qw[
+ TestApp::Controller::Action::End->begin
+ TestApp::Controller::Action::End->default
+ TestApp::View::Dump::Request->process
+ TestApp::Controller::Action::End->end
+ ];
-{
- my @expected = qw[
- TestApp::Controller::Action::End->begin
- TestApp::Controller::Action::End->default
- TestApp::View::Dump::Request->process
- TestApp::Controller::Action::End->end
- ];
+ my $expected = join( ", ", @expected );
- my $expected = join( ", ", @expected );
-
- ok( my $response = request('http://localhost/action/end'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::End', 'Test Class' );
- is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' );
- like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
+ ok( my $response = request('http://localhost/action/end'), 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::End',
+ 'Test Class'
+ );
+ is( $response->header('X-Catalyst-Executed'),
+ $expected, 'Executed actions' );
+ like(
+ $response->content,
+ qr/^bless\( .* 'Catalyst::Request' \)$/s,
+ 'Content is a serialized Catalyst::Request'
+ );
+ }
}
use FindBin;
use lib "$FindBin::Bin/../../../lib";
-use Test::More tests => 30;
+use Test::More tests => 300;
use Catalyst::Test 'TestApp';
-{
- my @expected = qw[
- TestApp::Controller::Action::Forward->begin
- TestApp::Controller::Action::Forward->one
- TestApp::Controller::Action::Forward->two
- TestApp::Controller::Action::Forward->three
- TestApp::Controller::Action::Forward->four
- TestApp::Controller::Action::Forward->five
- TestApp::View::Dump::Request->process
- ];
+for ( 1 .. 10 ) {
+ {
+ my @expected = qw[
+ TestApp::Controller::Action::Forward->begin
+ TestApp::Controller::Action::Forward->one
+ TestApp::Controller::Action::Forward->two
+ TestApp::Controller::Action::Forward->three
+ TestApp::Controller::Action::Forward->four
+ TestApp::Controller::Action::Forward->five
+ TestApp::View::Dump::Request->process
+ ];
- my $expected = join( ", ", @expected );
+ my $expected = join( ", ", @expected );
- # Test forward to global private action
- ok( my $response = request('http://localhost/action/forward/global'),
- 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'),
- 'action/forward/global', 'Main Class Action' );
+ # Test forward to global private action
+ ok( my $response = request('http://localhost/action/forward/global'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'),
+ 'action/forward/global', 'Main Class Action' );
- # Test forward to chain of actions.
- ok( $response = request('http://localhost/action/forward/one'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'),
- 'action/forward/one', 'Test Action' );
- is(
- $response->header('X-Test-Class'),
- 'TestApp::Controller::Action::Forward',
- 'Test Class'
- );
- is( $response->header('X-Catalyst-Executed'),
- $expected, 'Executed actions' );
- like(
- $response->content,
- qr/^bless\( .* 'Catalyst::Request' \)$/s,
- 'Content is a serialized Catalyst::Request'
- );
-}
+ # Test forward to chain of actions.
+ ok( $response = request('http://localhost/action/forward/one'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'),
+ 'action/forward/one', 'Test Action' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Forward',
+ 'Test Class'
+ );
+ is( $response->header('X-Catalyst-Executed'),
+ $expected, 'Executed actions' );
+ like(
+ $response->content,
+ qr/^bless\( .* 'Catalyst::Request' \)$/s,
+ 'Content is a serialized Catalyst::Request'
+ );
+ }
-{
- my @expected = qw[
- TestApp::Controller::Action::Forward->begin
- TestApp::Controller::Action::Forward->jojo
- TestApp::Controller::Action::Forward->one
- TestApp::Controller::Action::Forward->two
- TestApp::Controller::Action::Forward->three
- TestApp::Controller::Action::Forward->four
- TestApp::Controller::Action::Forward->five
- TestApp::View::Dump::Request->process
- TestApp::Controller::Action::Forward->three
- TestApp::Controller::Action::Forward->four
- TestApp::Controller::Action::Forward->five
- TestApp::View::Dump::Request->process
- ];
+ {
+ my @expected = qw[
+ TestApp::Controller::Action::Forward->begin
+ TestApp::Controller::Action::Forward->jojo
+ TestApp::Controller::Action::Forward->one
+ TestApp::Controller::Action::Forward->two
+ TestApp::Controller::Action::Forward->three
+ TestApp::Controller::Action::Forward->four
+ TestApp::Controller::Action::Forward->five
+ TestApp::View::Dump::Request->process
+ TestApp::Controller::Action::Forward->three
+ TestApp::Controller::Action::Forward->four
+ TestApp::Controller::Action::Forward->five
+ TestApp::View::Dump::Request->process
+ ];
- my $expected = join( ", ", @expected );
+ my $expected = join( ", ", @expected );
- ok( my $response = request('http://localhost/action/forward/jojo'),
- 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'),
- 'action/forward/jojo', 'Test Action' );
- is(
- $response->header('X-Test-Class'),
- 'TestApp::Controller::Action::Forward',
- 'Test Class'
- );
- is( $response->header('X-Catalyst-Executed'),
- $expected, 'Executed actions' );
- like(
- $response->content,
- qr/^bless\( .* 'Catalyst::Request' \)$/s,
- 'Content is a serialized Catalyst::Request'
- );
-}
+ ok( my $response = request('http://localhost/action/forward/jojo'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'),
+ 'action/forward/jojo', 'Test Action' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Forward',
+ 'Test Class'
+ );
+ is( $response->header('X-Catalyst-Executed'),
+ $expected, 'Executed actions' );
+ like(
+ $response->content,
+ qr/^bless\( .* 'Catalyst::Request' \)$/s,
+ 'Content is a serialized Catalyst::Request'
+ );
+ }
-{
- ok(
- my $response = request('http://localhost/action/forward/with_args/old'),
- 'Request with args'
- );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content, 'old' );
-}
+ {
+ ok(
+ my $response =
+ request('http://localhost/action/forward/with_args/old'),
+ 'Request with args'
+ );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content, 'old' );
+ }
-{
- ok(
- my $response =
- request('http://localhost/action/forward/with_method_and_args/old'),
- 'Request with args and method'
- );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content, 'old' );
-}
+ {
+ ok(
+ my $response = request(
+ 'http://localhost/action/forward/with_method_and_args/old'),
+ 'Request with args and method'
+ );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content, 'old' );
+ }
-# test forward with embedded args
-{
- ok(
- my $response =
- request('http://localhost/action/forward/args_embed_relative'),
- 'Request'
- );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content, 'ok' );
-}
+ # test forward with embedded args
+ {
+ ok(
+ my $response =
+ request('http://localhost/action/forward/args_embed_relative'),
+ 'Request'
+ );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content, 'ok' );
+ }
-{
- ok(
- my $response =
- request('http://localhost/action/forward/args_embed_absolute'),
- 'Request'
- );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content, 'ok' );
+ {
+ ok(
+ my $response =
+ request('http://localhost/action/forward/args_embed_absolute'),
+ 'Request'
+ );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content, 'ok' );
+ }
}
use FindBin;
use lib "$FindBin::Bin/../../../lib";
-use Test::More tests => 18;
+use Test::More tests => 180;
use Catalyst::Test 'TestApp';
+for ( 1 .. 10 ) {
+ {
+ ok( my $response = request('http://localhost/action_global_one'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'),
+ 'action_global_one', 'Test Action' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Global',
+ 'Test Class'
+ );
+ like(
+ $response->content,
+ qr/^bless\( .* 'Catalyst::Request' \)$/s,
+ 'Content is a serialized Catalyst::Request'
+ );
+ }
-{
- ok( my $response = request('http://localhost/action_global_one'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'action_global_one', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Global', 'Test Class' );
- like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
-}
-
-{
- ok( my $response = request('http://localhost/action_global_two'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'action_global_two', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Global', 'Test Class' );
- like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
-}
+ {
+ ok( my $response = request('http://localhost/action_global_two'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'),
+ 'action_global_two', 'Test Action' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Global',
+ 'Test Class'
+ );
+ like(
+ $response->content,
+ qr/^bless\( .* 'Catalyst::Request' \)$/s,
+ 'Content is a serialized Catalyst::Request'
+ );
+ }
-{
- ok( my $response = request('http://localhost/action_global_three'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'action_global_three', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Global', 'Test Class' );
- like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
+ {
+ ok( my $response = request('http://localhost/action_global_three'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'),
+ 'action_global_three', 'Test Action' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Global',
+ 'Test Class'
+ );
+ like(
+ $response->content,
+ qr/^bless\( .* 'Catalyst::Request' \)$/s,
+ 'Content is a serialized Catalyst::Request'
+ );
+ }
}
use FindBin;
use lib "$FindBin::Bin/../../../lib";
-use Test::More tests =>21;
+use Test::More tests => 210;
use Catalyst::Test 'TestApp';
+for ( 1 .. 10 ) {
+ {
+ my @expected = qw[
+ TestApp::Controller::Action::Inheritance->begin
+ TestApp::Controller::Action::Inheritance->auto
+ TestApp::Controller::Action::Inheritance->default
+ TestApp::View::Dump::Request->process
+ TestApp::Controller::Action::Inheritance->end
+ ];
-{
- my @expected = qw[
- TestApp::Controller::Action::Inheritance->begin
- TestApp::Controller::Action::Inheritance->auto
- TestApp::Controller::Action::Inheritance->default
- TestApp::View::Dump::Request->process
- TestApp::Controller::Action::Inheritance->end
- ];
+ my $expected = join( ", ", @expected );
- my $expected = join( ", ", @expected );
+ ok( my $response = request('http://localhost/action/inheritance'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Inheritance',
+ 'Test Class'
+ );
+ is( $response->header('X-Catalyst-Executed'),
+ $expected, 'Executed actions' );
+ like(
+ $response->content,
+ qr/^bless\( .* 'Catalyst::Request' \)$/s,
+ 'Content is a serialized Catalyst::Request'
+ );
+ }
- ok( my $response = request('http://localhost/action/inheritance'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Inheritance', 'Test Class' );
- is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' );
- like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
-}
-
-{
- my @expected = qw[
- TestApp::Controller::Action::Inheritance::A->begin
- TestApp::Controller::Action::Inheritance->auto
- TestApp::Controller::Action::Inheritance::A->auto
- TestApp::Controller::Action::Inheritance::A->default
- TestApp::View::Dump::Request->process
- TestApp::Controller::Action::Inheritance::A->end
- ];
+ {
+ my @expected = qw[
+ TestApp::Controller::Action::Inheritance::A->begin
+ TestApp::Controller::Action::Inheritance->auto
+ TestApp::Controller::Action::Inheritance::A->auto
+ TestApp::Controller::Action::Inheritance::A->default
+ TestApp::View::Dump::Request->process
+ TestApp::Controller::Action::Inheritance::A->end
+ ];
- my $expected = join( ", ", @expected );
+ my $expected = join( ", ", @expected );
- ok( my $response = request('http://localhost/action/inheritance/a'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Inheritance::A', 'Test Class' );
- is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' );
- like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
-}
+ ok( my $response = request('http://localhost/action/inheritance/a'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Inheritance::A',
+ 'Test Class'
+ );
+ is( $response->header('X-Catalyst-Executed'),
+ $expected, 'Executed actions' );
+ like(
+ $response->content,
+ qr/^bless\( .* 'Catalyst::Request' \)$/s,
+ 'Content is a serialized Catalyst::Request'
+ );
+ }
-{
- my @expected = qw[
- TestApp::Controller::Action::Inheritance::A::B->begin
- TestApp::Controller::Action::Inheritance->auto
- TestApp::Controller::Action::Inheritance::A->auto
- TestApp::Controller::Action::Inheritance::A::B->auto
- TestApp::Controller::Action::Inheritance::A::B->default
- TestApp::View::Dump::Request->process
- TestApp::Controller::Action::Inheritance::A::B->end
- ];
+ {
+ my @expected = qw[
+ TestApp::Controller::Action::Inheritance::A::B->begin
+ TestApp::Controller::Action::Inheritance->auto
+ TestApp::Controller::Action::Inheritance::A->auto
+ TestApp::Controller::Action::Inheritance::A::B->auto
+ TestApp::Controller::Action::Inheritance::A::B->default
+ TestApp::View::Dump::Request->process
+ TestApp::Controller::Action::Inheritance::A::B->end
+ ];
- my $expected = join( ", ", @expected );
+ my $expected = join( ", ", @expected );
- ok( my $response = request('http://localhost/action/inheritance/a/b'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Inheritance::A::B', 'Test Class' );
- is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' );
- like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
+ ok( my $response = request('http://localhost/action/inheritance/a/b'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Inheritance::A::B',
+ 'Test Class'
+ );
+ is( $response->header('X-Catalyst-Executed'),
+ $expected, 'Executed actions' );
+ like(
+ $response->content,
+ qr/^bless\( .* 'Catalyst::Request' \)$/s,
+ 'Content is a serialized Catalyst::Request'
+ );
+ }
}
use FindBin;
use lib "$FindBin::Bin/../../../lib";
-use Test::More tests => 24;
+use Test::More tests => 240;
use Catalyst::Test 'TestApp';
+for ( 1 .. 10 ) {
+ {
+ ok( my $response = request('http://localhost/action/local/one'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'),
+ 'action/local/one', 'Test Action' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Local',
+ 'Test Class'
+ );
+ like(
+ $response->content,
+ qr/^bless\( .* 'Catalyst::Request' \)$/s,
+ 'Content is a serialized Catalyst::Request'
+ );
+ }
-{
- ok( my $response = request('http://localhost/action/local/one'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'action/local/one', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Local', 'Test Class' );
- like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
-}
-
-{
- ok( my $response = request('http://localhost/action/local/two'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'action/local/two', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Local', 'Test Class' );
- like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
-}
+ {
+ ok( my $response = request('http://localhost/action/local/two'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'),
+ 'action/local/two', 'Test Action' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Local',
+ 'Test Class'
+ );
+ like(
+ $response->content,
+ qr/^bless\( .* 'Catalyst::Request' \)$/s,
+ 'Content is a serialized Catalyst::Request'
+ );
+ }
-{
- ok( my $response = request('http://localhost/action/local/three'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'action/local/three', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Local', 'Test Class' );
- like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
-}
+ {
+ ok( my $response = request('http://localhost/action/local/three'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'),
+ 'action/local/three', 'Test Action' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Local',
+ 'Test Class'
+ );
+ like(
+ $response->content,
+ qr/^bless\( .* 'Catalyst::Request' \)$/s,
+ 'Content is a serialized Catalyst::Request'
+ );
+ }
-{
- ok( my $response = request('http://localhost/action/local/four/five/six'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'action/local/four/five/six', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Local', 'Test Class' );
- like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
+ {
+ ok(
+ my $response =
+ request('http://localhost/action/local/four/five/six'),
+ 'Request'
+ );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'),
+ 'action/local/four/five/six', 'Test Action' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Local',
+ 'Test Class'
+ );
+ like(
+ $response->content,
+ qr/^bless\( .* 'Catalyst::Request' \)$/s,
+ 'Content is a serialized Catalyst::Request'
+ );
+ }
}
use FindBin;
use lib "$FindBin::Bin/../../../lib";
-use Test::More tests => 16;
+use Test::More tests => 160;
use Catalyst::Test 'TestApp';
my $content = q/foo
baz
/;
-# Local
-{
- ok( my $response = request('http://localhost/action/multipath/multipath'),
- 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->content, $content, 'Content is a stream' );
-}
-
-# Global
-{
- ok( my $response = request('http://localhost/multipath'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->content, $content, 'Content is a stream' );
-}
-
-# Path('/multipath1')
-{
- ok( my $response = request('http://localhost/multipath1'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->content, $content, 'Content is a stream' );
-}
-
-# Path('multipath2')
-{
- ok( my $response = request('http://localhost/action/multipath/multipath2'),
- 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->content, $content, 'Content is a stream' );
+for ( 1 .. 10 ) {
+
+ # Local
+ {
+ ok(
+ my $response =
+ request('http://localhost/action/multipath/multipath'),
+ 'Request'
+ );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->content, $content, 'Content is a stream' );
+ }
+
+ # Global
+ {
+ ok( my $response = request('http://localhost/multipath'), 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->content, $content, 'Content is a stream' );
+ }
+
+ # Path('/multipath1')
+ {
+ ok( my $response = request('http://localhost/multipath1'), 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->content, $content, 'Content is a stream' );
+ }
+
+ # Path('multipath2')
+ {
+ ok(
+ my $response =
+ request('http://localhost/action/multipath/multipath2'),
+ 'Request'
+ );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->content, $content, 'Content is a stream' );
+ }
}
use FindBin;
use lib "$FindBin::Bin/../../../lib";
-use Test::More tests => 12;
+use Test::More tests => 120;
use Catalyst::Test 'TestApp';
+for ( 1 .. 10 ) {
+ {
+ ok(
+ my $response =
+ request('http://localhost/action/path/a path with spaces'),
+ 'Request'
+ );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is(
+ $response->header('X-Catalyst-Action'),
+ 'action/path/a path with spaces',
+ 'Test Action'
+ );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Path',
+ 'Test Class'
+ );
+ like(
+ $response->content,
+ qr/^bless\( .* 'Catalyst::Request' \)$/s,
+ 'Content is a serialized Catalyst::Request'
+ );
+ }
-{
- ok( my $response = request('http://localhost/action/path/a path with spaces'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'action/path/a path with spaces', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Path', 'Test Class' );
- like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
-}
-
-{
- ok( my $response = request('http://localhost/action/path/åäö'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), 'action/path/åäö', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Path', 'Test Class' );
- like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
+ {
+ ok( my $response = request('http://localhost/action/path/åäö'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'),
+ 'action/path/åäö', 'Test Action' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Path',
+ 'Test Class'
+ );
+ like(
+ $response->content,
+ qr/^bless\( .* 'Catalyst::Request' \)$/s,
+ 'Content is a serialized Catalyst::Request'
+ );
+ }
}
use FindBin;
use lib "$FindBin::Bin/../../../lib";
-use Test::More tests => 24;
+use Test::More tests => 240;
use Catalyst::Test 'TestApp';
+for ( 1 .. 10 ) {
+ {
+ ok( my $response = request('http://localhost/action/private/one'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Private',
+ 'Test Class'
+ );
+ is( $response->content, 'access denied', 'Access' );
+ }
-{
- ok( my $response = request('http://localhost/action/private/one'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Private', 'Test Class' );
- is( $response->content, 'access denied', 'Access' );
-}
+ {
+ ok( my $response = request('http://localhost/action/private/two'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Private',
+ 'Test Class'
+ );
+ is( $response->content, 'access denied', 'Access' );
+ }
-{
- ok( my $response = request('http://localhost/action/private/two'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Private', 'Test Class' );
- is( $response->content, 'access denied', 'Access' );
-}
+ {
+ ok( my $response = request('http://localhost/three'), 'Request' );
+ ok( $response->is_error, 'Response Server Error 5xx' );
+ is( $response->content_type, 'text/html', 'Response Content-Type' );
+ like(
+ $response->header('X-Catalyst-Error'),
+ qr/^Unknown resource "three"/,
+ 'Catalyst Error'
+ );
+ }
-{
- ok( my $response = request('http://localhost/three'), 'Request' );
- ok( $response->is_error, 'Response Server Error 5xx' );
- is( $response->content_type, 'text/html', 'Response Content-Type' );
- like( $response->header('X-Catalyst-Error'), qr/^Unknown resource "three"/, 'Catalyst Error' );
-}
-
-{
- ok( my $response = request('http://localhost/action/private/four'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Private', 'Test Class' );
- is( $response->content, 'access denied', 'Access' );
-}
+ {
+ ok( my $response = request('http://localhost/action/private/four'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Private',
+ 'Test Class'
+ );
+ is( $response->content, 'access denied', 'Access' );
+ }
-{
- ok( my $response = request('http://localhost/action/private/five'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Private', 'Test Class' );
- is( $response->content, 'access denied', 'Access' );
+ {
+ ok( my $response = request('http://localhost/action/private/five'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Private',
+ 'Test Class'
+ );
+ is( $response->content, 'access denied', 'Access' );
+ }
}
use FindBin;
use lib "$FindBin::Bin/../../../lib";
-use Test::More tests => 12;
+use Test::More tests => 120;
use Catalyst::Test 'TestApp';
+for ( 1 .. 10 ) {
+ {
+ ok( my $response = request('http://localhost/action/regexp/10/hello'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'),
+ '^action/regexp/(\d+)/(\w+)$', 'Test Action' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Regexp',
+ 'Test Class'
+ );
+ like(
+ $response->content,
+ qr/^bless\( .* 'Catalyst::Request' \)$/s,
+ 'Content is a serialized Catalyst::Request'
+ );
+ }
-{
- ok( my $response = request('http://localhost/action/regexp/10/hello'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), '^action/regexp/(\d+)/(\w+)$', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Regexp', 'Test Class' );
- like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
-}
-
-{
- ok( my $response = request('http://localhost/action/regexp/hello/10'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->header('X-Catalyst-Action'), '^action/regexp/(\w+)/(\d+)$', 'Test Action' );
- is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Regexp', 'Test Class' );
- like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
+ {
+ ok( my $response = request('http://localhost/action/regexp/hello/10'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->header('X-Catalyst-Action'),
+ '^action/regexp/(\w+)/(\d+)$', 'Test Action' );
+ is(
+ $response->header('X-Test-Class'),
+ 'TestApp::Controller::Action::Regexp',
+ 'Test Class'
+ );
+ like(
+ $response->content,
+ qr/^bless\( .* 'Catalyst::Request' \)$/s,
+ 'Content is a serialized Catalyst::Request'
+ );
+ }
}
use FindBin;
use lib "$FindBin::Bin/../../../lib";
-use Test::More tests => 8;
+use Test::More tests => 80;
use Catalyst::Test 'TestApp';
-# test direct streaming
-{
- ok( my $response = request('http://localhost/streaming'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->content,, <<'EOF', 'Content is a stream' );
+for ( 1 .. 10 ) {
+
+ # test direct streaming
+ {
+ ok( my $response = request('http://localhost/streaming'), 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->content,, <<'EOF', 'Content is a stream' );
foo
bar
baz
EOF
-}
-
-# test streaming by passing a handle to $c->res->body
-SKIP:
-{
- if ( $ENV{CATALYST_SERVER} ) {
- skip "Using remote server", 4;
}
-
- my $file = "$FindBin::Bin/../../../../01use.t";
- my $fh = IO::File->new( $file, 'r' );
- my $buffer;
- if ( defined $fh ) {
- $fh->read( $buffer, 1024 );
- $fh->close;
+
+ # test streaming by passing a handle to $c->res->body
+ SKIP:
+ {
+ if ( $ENV{CATALYST_SERVER} ) {
+ skip "Using remote server", 4;
+ }
+
+ my $file = "$FindBin::Bin/../../../../01use.t";
+ my $fh = IO::File->new( $file, 'r' );
+ my $buffer;
+ if ( defined $fh ) {
+ $fh->read( $buffer, 1024 );
+ $fh->close;
+ }
+
+ ok( my $response = request('http://localhost/action/streaming/body'),
+ 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->content_type, 'text/plain', 'Response Content-Type' );
+ is( $response->content, $buffer, 'Content is read from filehandle' );
}
-
- ok( my $response = request('http://localhost/action/streaming/body'), 'Request' );
- ok( $response->is_success, 'Response Successful 2xx' );
- is( $response->content_type, 'text/plain', 'Response Content-Type' );
- is( $response->content, $buffer, 'Content is read from filehandle' );
}