-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Use microtime to set lastLogin
Signed-off-by: Louis Chemineau <[email protected]>
- Loading branch information
Showing
1 changed file
with
11 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -673,23 +673,23 @@ public function testRecentlyActive(): void { | |
$manager = \OCP\Server::get(IUserManager::class); | ||
|
||
// Create some users | ||
$now = (string)time(); | ||
$now = microtime(); | ||
$user1 = $manager->createUser('test_active_1', 'test_active_1'); | ||
$config->setUserValue('test_active_1', 'login', 'lastLogin', $now); | ||
$config->setUserValue('test_active_1', 'login', 'lastLogin', (string)$now); | ||
$user1->setDisplayName('test active 1'); | ||
$user1->setSystemEMailAddress('[email protected]'); | ||
|
||
$user2 = $manager->createUser('TEST_ACTIVE_2_FRED', 'TEST_ACTIVE_2'); | ||
$config->setUserValue('TEST_ACTIVE_2_FRED', 'login', 'lastLogin', $now); | ||
$config->setUserValue('TEST_ACTIVE_2_FRED', 'login', 'lastLogin', (string)$now); | ||
$user2->setDisplayName('TEST ACTIVE 2 UPPER'); | ||
$user2->setSystemEMailAddress('[email protected]'); | ||
|
||
$user3 = $manager->createUser('test_active_3', 'test_active_3'); | ||
$config->setUserValue('test_active_3', 'login', 'lastLogin', $now + 1); | ||
$config->setUserValue('test_active_3', 'login', 'lastLogin', (string)($now + 1)); | ||
$user3->setDisplayName('test active 3'); | ||
|
||
$user4 = $manager->createUser('test_active_4', 'test_active_4'); | ||
$config->setUserValue('test_active_4', 'login', 'lastLogin', $now); | ||
$config->setUserValue('test_active_4', 'login', 'lastLogin', (string)$now); | ||
$user4->setDisplayName('Test Active 4'); | ||
|
||
$user5 = $manager->createUser('test_inactive_1', 'test_inactive_1'); | ||
|
@@ -722,6 +722,12 @@ public function testRecentlyActive(): void { | |
$user3->delete(); | ||
$user4->delete(); | ||
$user5->delete(); | ||
|
||
$config->deleteAllUserValues($user1->getUID()); | ||
$config->deleteAllUserValues($user2->getUID()); | ||
$config->deleteAllUserValues($user3->getUID()); | ||
$config->deleteAllUserValues($user4->getUID()); | ||
$config->deleteAllUserValues($user5->getUID()); | ||
} | ||
|
||
public function testDeleteUser(): void { | ||
|