Add tests for hasFriends with 100% coverage.
This commit is contained in:
parent
39785cf169
commit
9e1b9d2f49
1 changed files with 12 additions and 1 deletions
13
t/User.t
13
t/User.t
|
|
@ -20,7 +20,7 @@ use WebGUI::Cache;
|
|||
use WebGUI::User;
|
||||
use WebGUI::ProfileField;
|
||||
|
||||
use Test::More tests => 147; # increment this value for each test you create
|
||||
use Test::More tests => 149; # increment this value for each test you create
|
||||
use Test::Deep;
|
||||
|
||||
my $session = WebGUI::Test->session;
|
||||
|
|
@ -672,6 +672,17 @@ is(
|
|||
'getProfileUrl: uses session->url->page if no URL is passed in'
|
||||
);
|
||||
|
||||
################################################################
|
||||
#
|
||||
# hasFriends
|
||||
#
|
||||
################################################################
|
||||
|
||||
ok(! $neighbor->hasFriends, 'hasFriends, user has no friends');
|
||||
$friend->addToGroups([$neighbor->friends->getId]);
|
||||
ok( $neighbor->hasFriends, 'hasFriends, user has a friend');
|
||||
$friend->deleteFromGroups([$neighbor->friends->getId]);
|
||||
|
||||
END {
|
||||
foreach my $account ($user, $dude, $buster, $buster3, $neighbor, $friend, $newFish, $newCreateUser) {
|
||||
(defined $account and ref $account eq 'WebGUI::User') and $account->delete;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue