$ENV
{CGI_APP_RETURN_ONLY} = 1;
my
$testapp
= TestAppScope->new(
QUERY
=>CGI->new());
my
$output
=
$testapp
->run();
$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
);
$query
->param(
-name
=>
'rm'
,
-value
=>
'third'
);
$testapp
= TestAppScope->new(
QUERY
=>
$query
);
$output
=
$testapp
->run;
$test_name
=
"message is not in the output"
;
unlike(
$output
,
qr/this is a test/
,
$test_name
);
$query
->param(
-name
=>
'rm'
,
-value
=>
'cleanup'
);
$testapp
= TestAppScope->new(
QUERY
=>
$query
);
$output
=
$testapp
->run;
undef
$testapp
;