CGI-Application-Plugin-MessageStack

 view release on metacpan or  search on metacpan

t/02-check_output.t  view on Meta::CPAN


use CGI;
use TestAppOutput;

my $testapp = TestAppOutput->new(QUERY=>CGI->new());
my $output = $testapp->run();

# $output should have the session setup w/ a cookie
# Get the ID # to establish the session in a second request
my $test_name = 'session cookie was setup';
like( $output, qr/Set-Cookie: CGISESSID=\w+/, $test_name );
$output =~ /Set-Cookie: CGISESSID=(\w+);/;
my $session_id = $1;
$test_name = "got the session id ($session_id)";
ok( $session_id, $test_name );

$test_name = "message isn't in output";
unlike( $output, qr/this is a test/, $test_name );

$ENV{HTTP_COOKIE} = "CGISESSID=$session_id";
my $query = new CGI;
$query->param( -name => 'rm', -value => 'second' );

t/03-scope.t  view on Meta::CPAN

plan tests => 6;

use CGI;
use TestAppScope;

my $testapp = TestAppScope->new(QUERY=>CGI->new());
my $output = $testapp->run();

# $output should have the session setup w/ a cookie
# Get the ID # to establish the session in a second request
$output =~ /Set-Cookie: CGISESSID=(\w+);/;
my $session_id = $1;

$ENV{HTTP_COOKIE} = "CGISESSID=$session_id";
my $query = new CGI;
$query->param( -name => 'rm', -value => 'second' );
$testapp = TestAppScope->new( QUERY => $query );
$output = $testapp->run;

my $test_name = "got the expected output";
like( $output, qr/scoped message pushed/, $test_name );

t/04-messages.t  view on Meta::CPAN

plan tests => 8;

use CGI;
use TestAppMessages;

my $testapp = TestAppMessages->new(QUERY=>CGI->new());
my $output = $testapp->run();

# $output should have the session setup w/ a cookie
# Get the ID # to establish the session in a second request
$output =~ /Set-Cookie: CGISESSID=(\w+);/;
my $session_id = $1;

$ENV{HTTP_COOKIE} = "CGISESSID=$session_id";
my $query = new CGI;
$query->param( -name => 'rm', -value => 'second' );
$testapp = TestAppMessages->new( QUERY => $query );
$output = $testapp->run;

my $test_name = "got the expected output (all messages)";
like( $output, qr/succeeded/, $test_name );

t/05-clear_messages.t  view on Meta::CPAN

$ENV{CGI_APP_RETURN_ONLY} = 1;

use CGI;
use TestAppClear;

my $testapp = TestAppClear->new(QUERY=>CGI->new());
my $output = $testapp->run();

# $output should have the session setup w/ a cookie
# Get the ID # to establish the session in a second request
$output =~ /Set-Cookie: CGISESSID=(\w+);/;
my $session_id = $1;

$ENV{HTTP_COOKIE} = "CGISESSID=$session_id";
my $query = new CGI;
$query->param( -name => 'rm', -value => 'second' );
$testapp = TestAppClear->new( QUERY => $query );
$output = $testapp->run;

my $test_name = "got the expected output (cleared all messages)";
like( $output, qr/succeeded/, $test_name );

t/06-pop_message.t  view on Meta::CPAN

$ENV{CGI_APP_RETURN_ONLY} = 1;

use CGI;
use TestAppPop;

my $testapp = TestAppPop->new(QUERY=>CGI->new());
my $output = $testapp->run();

# $output should have the session setup w/ a cookie
# Get the ID # to establish the session in a second request
$output =~ /Set-Cookie: CGISESSID=(\w+);/;
my $session_id = $1;

$ENV{HTTP_COOKIE} = "CGISESSID=$session_id";
my $query = new CGI;
$query->param( -name => 'rm', -value => 'second' );
$testapp = TestAppPop->new( QUERY => $query );
$output = $testapp->run;

my $test_name = "got the expected output (pop'd the last msg)";
like( $output, qr/succeeded/, $test_name );

t/07-template_toolkit.t  view on Meta::CPAN

use CGI;

plan tests => 8;

my $testapp = TestAppTT->new(QUERY=>CGI->new());
my $output = $testapp->run();

# $output should have the session setup w/ a cookie
# Get the ID # to establish the session in a second request
my $test_name = 'session cookie was setup';
like( $output, qr/Set-Cookie: CGISESSID=\w+/, $test_name );
$output =~ /Set-Cookie: CGISESSID=(\w+);/;
my $session_id = $1;
$test_name = "got the session id ($session_id)";
ok( $session_id, $test_name );

$test_name = "message isn't in output";
unlike( $output, qr/this is a test/, $test_name );

$ENV{HTTP_COOKIE} = "CGISESSID=$session_id";
my $query = new CGI;
$query->param( -name => 'rm', -value => 'second' );

t/08-capms_config_ac.t  view on Meta::CPAN


use CGI;
use TestAppConfigAC;

my $testapp = TestAppConfigAC->new(QUERY=>CGI->new());
my $output = $testapp->run();
my $test_name;

# $output should have the session setup w/ a cookie
# Get the ID # to establish the session in a second request
$output =~ /Set-Cookie: CGISESSID=(\w+);/;
my $session_id = $1;

$ENV{HTTP_COOKIE} = "CGISESSID=$session_id";
my $query = new CGI;
$query->param( -name => 'rm', -value => 'second' );
$testapp = TestAppConfigAC->new( QUERY => $query );
$output = $testapp->run;

$test_name = "got the expected outputs";
# testing for an array of data here...

t/09-capms_config_params.t  view on Meta::CPAN


use CGI;
use TestAppConfigParams;

my $testapp = TestAppConfigParams->new(QUERY=>CGI->new());
my $output = $testapp->run();
my $test_name;

# $output should have the session setup w/ a cookie
# Get the ID # to establish the session in a second request
$output =~ /Set-Cookie: CGISESSID=(\w+);/;
my $session_id = $1;

$ENV{HTTP_COOKIE} = "CGISESSID=$session_id";
my $query = new CGI;
$query->param( -name => 'rm', -value => 'second' );
$testapp = TestAppConfigParams->new( QUERY => $query );
$output = $testapp->run;

$test_name = "making sure bad template params aren't being filled";
# testing for an array of data here...



( run in 0.552 second using v1.01-cache-2.11-cpan-e9199f4ba4c )