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
|
|
@ -708,11 +708,12 @@ sub new {
|
|||
|
||||
=head2 scratchFilter ( [ value ] )
|
||||
|
||||
Returns the name of this group.
|
||||
Returns the scratch value that should be set to automatically add this user
|
||||
to a group.
|
||||
|
||||
=head3 value
|
||||
|
||||
If specified, the name is set to this value.
|
||||
If specified, the scratchFilter is set to this value.
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -749,8 +750,6 @@ sub showInForms {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 dbQuery ( )
|
||||
|
||||
=head2 dbQuery ( [ value ] )
|
||||
|
||||
Returns the dbQuery for this group.
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ sub www_deleteGroupConfirm {
|
|||
return $session->privilege->vitalComponent() if (isIn($session->form->process("gid"), qw(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17)));
|
||||
my $g = WebGUI::Group->new($session,$session->form->process("gid"));
|
||||
$g->delete;
|
||||
return www_listGroups();
|
||||
return www_listGroups($session);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -429,7 +429,7 @@ sub www_editGroupSave {
|
|||
$g->ldapGroup($session->form->text("ldapGroup"));
|
||||
$g->ldapGroupProperty($session->form->text("ldapGroupProperty"));
|
||||
$g->ldapRecursiveProperty($session->form->text("ldapRecursiveProperty"));
|
||||
return www_listGroups();
|
||||
return www_listGroups($session);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
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