8 eval { require Catalyst::Plugin::Session::State::Cookie; Catalyst::Plugin::Session::State::Cookie->VERSION(0.03) }
10 "Catalyst::Plugin::Session::State::Cookie 0.03 or higher is required for this test";
13 require Test::WWW::Mechanize::PSGI;
14 #Test::WWW::Mechanize::Catalyst->VERSION(0.51);
17 'Test::WWW::Mechanize::PSGI is required for this test';
19 eval { require Catalyst::Plugin::Authentication; 1 }
20 or plan skip_all => "Catalyst::Plugin::Authentication is required for this test";
26 use Test::WWW::Mechanize::PSGI;
28 my $ua = Test::WWW::Mechanize::PSGI->new(
29 app => SessionTestApp->psgi_app(@_),
33 # Test without delete __address
34 local $ENV{REMOTE_ADDR} = "192.168.1.1";
36 $ua->get_ok( "http://localhost/login" );
37 $ua->content_contains('logged in');
39 $ua->get_ok( "http://localhost/set_session_variable/logged/in" );
40 $ua->content_contains('session variable set');
45 my $app = SessionTestApp->psgi_app(@_);
46 my $ua2 = Test::WWW::Mechanize::PSGI->new(
50 $ua2->get_ok( "http://localhost/get_session_variable/logged");
51 $ua2->content_contains('VAR_logged=n.a.');
54 local $ENV{REMOTE_ADDR} = "192.168.1.1";
56 $ua->get_ok( "http://localhost/login_without_address" );
57 $ua->content_contains('logged in (without address)');
59 $ua->get_ok( "http://localhost/set_session_variable/logged/in" );
60 $ua->content_contains('session variable set');
63 local $ENV{REMOTE_ADDR} = "192.168.1.2";
65 $ua->get_ok( "http://localhost/get_session_variable/logged" );
66 $ua->content_contains('VAR_logged=in');