6 use Test::More tests => 4;
7 use Test::MockObject::Extends;
11 BEGIN { use_ok( $m = "Catalyst::Plugin::Session" ) }
13 my $c = Test::MockObject::Extends->new($m);
17 get_session_data => sub {
19 return $key =~ /expire/ ? time() + 1000 : $flash;
22 $c->set_true("store_session_data");
23 #$c->set_always( _sessionid => "deadbeef" );
24 $c->set_always( config => { session => { expires => 1000 } } );
25 $c->set_always( stash => {} );
26 $c->set_always( log => my $log = Test::MockObject->new );
27 $log->set_true( "warn" );
29 $c->sessionid('deadbeef');
30 is_deeply($c->sessionid(), 'deadbeef', "Session not set properly.");
34 $c->sessionid('deadbeef2');
35 is_deeply($c->sessionid(), 'deadbeef', "Session was not stomped!.");
37 $log->called_ok("warn");