Adding basic UserList tests
This commit is contained in:
parent
9968a25729
commit
bc88cb3183
1 changed files with 52 additions and 0 deletions
52
t/Asset/Wobject/UserList.t
Normal file
52
t/Asset/Wobject/UserList.t
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2008 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 File::Spec;
|
||||
use lib "$FindBin::Bin/../../lib";
|
||||
|
||||
##The goal of this test is to test the creation of UserList Wobjects.
|
||||
|
||||
use WebGUI::Test;
|
||||
use WebGUI::Session;
|
||||
use Test::More tests => 5; # increment this value for each test you create
|
||||
use WebGUI::Asset::Wobject::UserList;
|
||||
|
||||
my $session = WebGUI::Test->session;
|
||||
|
||||
# Do our work in the import node
|
||||
my $node = WebGUI::Asset->getImportNode($session);
|
||||
|
||||
my $versionTag = WebGUI::VersionTag->getWorking($session);
|
||||
$versionTag->set({name=>"UserList Test"});
|
||||
my $userList = $node->addChild({className=>'WebGUI::Asset::Wobject::UserList'});
|
||||
|
||||
# Test for a sane object type
|
||||
isa_ok($userList, 'WebGUI::Asset::Wobject::UserList');
|
||||
|
||||
# Test to see if we can set new values
|
||||
my $newUserListSettings = {
|
||||
usersPerPage => 124,
|
||||
showGroupId => 7,
|
||||
hideGroupId => 3,
|
||||
alphabet => 'a,b,c',
|
||||
};
|
||||
$userList->update($newUserListSettings);
|
||||
|
||||
foreach my $newSetting (keys %{$newUserListSettings}) {
|
||||
is ($userList->get($newSetting), $newUserListSettings->{$newSetting}, "updated $newSetting is ".$newUserListSettings->{$newSetting});
|
||||
}
|
||||
|
||||
END {
|
||||
# Clean up after thy self
|
||||
$versionTag->rollback();
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue