merging 8374

This commit is contained in:
Doug Bell 2008-11-14 22:19:15 +00:00
parent c9946708b5
commit 2f8869292f
4 changed files with 140 additions and 5 deletions

View file

@ -20,7 +20,7 @@ use WebGUI::Cache;
use WebGUI::User;
use WebGUI::ProfileField;
use Test::More tests => 140; # increment this value for each test you create
use Test::More tests => 143; # increment this value for each test you create
use Test::Deep;
my $session = WebGUI::Test->session;
@ -620,8 +620,26 @@ cmp_bag(
'getGroupIdsRecursive returns the correct set of groups, ignoring expire date and not duplicating groups'
);
#----------------------------------------------------------------------------
# Test the new create() method
SKIP: {
eval{ require Test::Exception; import Test::Exception };
skip 1, 'Test::Exception not found' if $@;
throws_ok( sub{ WebGUI::User->create }, 'WebGUI::Error::InvalidObject',
'create() throws if no session passed'
);
};
ok( my $newCreateUser = WebGUI::User->create( $session ),
'create() returns something'
);
isa_ok( $newCreateUser, 'WebGUI::User', 'create() returns a WebGUI::User' );
END {
foreach my $account ($user, $dude, $buster, $buster3, $neighbor, $friend, $newFish) {
foreach my $account ($user, $dude, $buster, $buster3, $neighbor, $friend, $newFish, $newCreateUser) {
(defined $account and ref $account eq 'WebGUI::User') and $account->delete;
}