Very beginning of Group test that cleans up after itself.
Operation/Group wasn't passing session var internally. Fixed WebGUI::Group POD docs.
This commit is contained in:
parent
b4ea20ef63
commit
acdd58aec6
3 changed files with 44 additions and 6 deletions
39
t/Group.t
Normal file
39
t/Group.t
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#-------------------------------------------------------------------
|
||||
# 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::Utility;
|
||||
|
||||
use WebGUI::User;
|
||||
use WebGUI::Group;
|
||||
use Test::More tests => 4; # increment this value for each test you create
|
||||
|
||||
my $session = WebGUI::Test->session;
|
||||
|
||||
my $g = WebGUI::Group->new($session, "new");
|
||||
|
||||
diag("Object creation and defaults");
|
||||
is( ref $g, "WebGUI::Group", "Group object creation");
|
||||
isnt( $g->getId, "new", "Group assigned new groupId, not new");
|
||||
is( length($g->getId), 22, "GroupId is proper length");
|
||||
|
||||
my $gid = $g->getId;
|
||||
|
||||
$g->delete();
|
||||
|
||||
my $matchingGroups = $session->db->quickArray("select groupId from groups where groupId=".$session->db->quote($gid));
|
||||
|
||||
is ( $matchingGroups, 0, 'group was removed');
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue