more delta time fixes
This commit is contained in:
parent
b02a93b491
commit
751adbcf30
2 changed files with 5 additions and 5 deletions
|
|
@ -231,7 +231,7 @@ my $expireOffset = $gX->expireOffset;
|
|||
$user->addToGroups([$gX->getId]);
|
||||
##User expire time is calculated correctly
|
||||
my $expireTime = abs($gX->userGroupExpireDate($user->userId) - $expireOffset - time());
|
||||
ok( $expireTime < 1, 'userGroupExpireDate: Default expire time');
|
||||
cmp_ok( $expireTime, '<=', 1, 'userGroupExpireDate: Default expire time');
|
||||
ok($user->isInGroup($gX->getId), "addToGroups: Added dude to gX");
|
||||
|
||||
$gX->userIsAdmin($user->userId, 1);
|
||||
|
|
|
|||
8
t/User.t
8
t/User.t
|
|
@ -78,9 +78,9 @@ $user->authMethod("LDAP");
|
|||
is($user->authMethod, "LDAP", 'authMethod() -- set to LDAP');
|
||||
$user->authMethod("WebGUI");
|
||||
is($user->authMethod, "WebGUI", 'authMethod() -- set back to WebGUI');
|
||||
ok(abs($user->lastUpdated-$lastUpdate) < 1, 'lastUpdated() -- authmethod change');
|
||||
cmp_ok(abs($user->lastUpdated-$lastUpdate), '<=', 1, 'lastUpdated() -- authmethod change');
|
||||
|
||||
#See if datecreated is correct
|
||||
#See if date created is correct
|
||||
is($user->dateCreated, $userCreationTime, 'dateCreated()');
|
||||
|
||||
#get/set karma
|
||||
|
|
@ -101,7 +101,7 @@ is($user->karma, $oldKarma-69, 'karma() -- get/set subtract amount');
|
|||
$lastUpdate = time();
|
||||
$user->referringAffiliate(10);
|
||||
is($user->referringAffiliate, '10', 'referringAffiliate() -- get/set');
|
||||
ok(abs($user->lastUpdated-$lastUpdate) < 1, 'lastUpdated() -- referringAffiliate');
|
||||
cmp_ok(abs($user->lastUpdated-$lastUpdate), '<=', 1, 'lastUpdated() -- referringAffiliate');
|
||||
|
||||
#Let's try adding this user to some groups. Note, users are auto-added to 2 and 7 on creation
|
||||
my @groups = qw|6 4|;
|
||||
|
|
@ -173,7 +173,7 @@ is($user->karma, $oldKarma-69, 'karma() -- get/set subtract amount');
|
|||
$lastUpdate = time();
|
||||
$user->referringAffiliate(10);
|
||||
is($user->referringAffiliate, '10', 'referringAffiliate() -- get/set');
|
||||
ok(abs($user->lastUpdated-$lastUpdate) < 1, 'lastUpdated() -- referringAffiliate');
|
||||
cmp_ok(abs($user->lastUpdated-$lastUpdate), '<=', 1, 'lastUpdated() -- referringAffiliate');
|
||||
|
||||
#Let's try adding this user to some groups
|
||||
my @groups = qw|2 4|;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue