1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
# $Id: api3_file_freezethaw.t,v 1.2 2002/11/22 22:54:41 sherzodr Exp $
use strict;
BEGIN {
use Test::More;
# Check if DB_File is avaialble. Otherwise, skip this test
eval 'require FreezeThaw';
plan skip_all => 'FreezeThaw not available' if $@;
plan(tests => 14);
use_ok('CGI::Session',qw/-api3/);
};
#########################
my $s = CGI::Session->new("serializer:FreezeThaw", undef, {Directory=>"t"} );
ok($s);
ok($s->id);
$s->param(author=>'Sherzod Ruzmetov', name => 'CGI::Session', version=>'1' );
ok($s->param('author'));
ok($s->param('name'));
ok($s->param('version'));
$s->param(-name=>'email', -value=>'sherzodr@cpan.org');
ok($s->param(-name=>'email'));
ok(!$s->expire() );
$s->expire("+10m");
ok($s->expire());
my $sid = $s->id();
$s->flush();
my $s2 = CGI::Session->new("serializer:FreezeThaw", $sid, {Directory=>'t'});
ok($s2);
ok($s2->id() eq $sid);
ok($s2->param('email'));
ok($s2->param('author'));
ok($s2->expire());
$s2->delete();
|