Pull more test over from Var.
This commit is contained in:
parent
999cbf70f3
commit
e319f56a04
1 changed files with 14 additions and 1 deletions
15
t/Session.t
15
t/Session.t
|
|
@ -30,7 +30,7 @@ is($userId, $user->userId, 'changing session user changes sessionId inside userS
|
|||
|
||||
$session->user({userId => 3});
|
||||
is($session->user->userId, 3, 'Set session user to Admin, check userId==3');
|
||||
is($session->user->profileField('uiLevel'), 9, 'Set session user to Admin, check uiLevel==9');
|
||||
is($session->user->get('uiLevel'), 9, 'Set session user to Admin, check uiLevel==9');
|
||||
|
||||
my $dupe = $session->duplicate;
|
||||
WebGUI::Test->addToCleanup($dupe);
|
||||
|
|
@ -92,6 +92,19 @@ is($varSession->get('adminOn'), $varSession->isAdminOn, "get('adminOn') and isAd
|
|||
is($varSession->get('adminOn'), 0, "adminOn is off by default"); ##retest
|
||||
is($varSession->get('lastIP'), '192.168.0.34', "lastIP fetched");
|
||||
|
||||
|
||||
my $var2 = WebGUI::Session->open($session->config, undef, 'illegalSessionIdThatIsTooLong');
|
||||
# '1234567890123456789012'
|
||||
isa_ok($var2, 'WebGUI::Session', 'invalid sessionId will still produce a Session object');
|
||||
($count) = $session->db->quickArray("select count(*) from userSession where sessionId=?",[$var2->getId]);
|
||||
is($count, 0, "object store of sessionId does not match database record");
|
||||
my $var2Id = $var2->getId;
|
||||
$var2->end;
|
||||
my $idToDelete = substr $var2Id,0,22;
|
||||
($count) = $session->db->quickArray("select count(*) from userSession where sessionId=?",[$idToDelete]);
|
||||
is($count, 1, "Unable to delete database record for Var object with invalid sessionId");
|
||||
|
||||
|
||||
done_testing;
|
||||
|
||||
#vim:ft=perl
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue