beginnings of Session testbench
This commit is contained in:
parent
ae8f3d87f6
commit
f3404c319a
1 changed files with 38 additions and 0 deletions
38
t/Session.t
Normal file
38
t/Session.t
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2006 Plain Black Corporation.
|
||||
#-------------------------------------------------------------------
|
||||
# Please read the legal notices (docs/legal.txt) and the license
|
||||
# (docs/license.txt) that came with this distribution before using
|
||||
# this software.
|
||||
#-------------------------------------------------------------------
|
||||
# http://www.plainblack.com info@plainblack.com
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
use FindBin;
|
||||
use strict;
|
||||
use lib "$FindBin::Bin/lib";
|
||||
|
||||
use WebGUI::Test;
|
||||
use WebGUI::Session;
|
||||
|
||||
use WebGUI::User;
|
||||
|
||||
use Test::More;
|
||||
|
||||
plan tests => 1; # increment this value for each test you create
|
||||
|
||||
my $session = WebGUI::Test->session;
|
||||
|
||||
my $user = WebGUI::User->new($session, "new");
|
||||
|
||||
$session->user({user => $user});
|
||||
|
||||
my ($userId) = $session->db->quickArray("select userId from userSession where sessionId=?",[$session->getId]);
|
||||
|
||||
is($userId, $user->userId, 'changing session user changes sessionId inside userSession table');
|
||||
|
||||
END {
|
||||
foreach my $dude ($user) {
|
||||
$dude->delete if (defined $dude and ref $dude eq 'WebGUI::User');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue