From f3404c319af0a5da153b5431b8c8474aef64518f Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 6 Apr 2006 23:19:59 +0000 Subject: [PATCH] beginnings of Session testbench --- t/Session.t | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 t/Session.t diff --git a/t/Session.t b/t/Session.t new file mode 100644 index 000000000..a0404dfa0 --- /dev/null +++ b/t/Session.t @@ -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'); + } +}