]> source.dussan.org Git - nextcloud-server.git/commitdiff
expect invalidateTokensOfUser only be called for seen users
authorArtur Neumann <artur@jankaritech.com>
Fri, 19 May 2023 06:42:20 +0000 (12:27 +0545)
committerArtur Neumann <artur@jankaritech.com>
Fri, 19 May 2023 06:42:20 +0000 (12:27 +0545)
Signed-off-by: Artur Neumann <artur@jankaritech.com>
apps/oauth2/tests/Controller/SettingsControllerTest.php

index e79d7cbe34ef1648bea27d430e1dd6f60ad3f8ef..fe26fb4607adc4f15dab61db440e5df1b12d2de3 100644 (file)
@@ -135,10 +135,13 @@ class SettingsControllerTest extends TestCase {
                // count other users in the db before adding our own
                $count = 0;
                $function = function (IUser $user) use (&$count) {
-                       $count++;
+                       if ($user->getLastLogin() > 0) {
+                               $count++;
+                       }
                };
                $userManager->callForAllUsers($function);
                $user1 = $userManager->createUser('test101', 'test101');
+               $user1->updateLastLoginTimestamp();
                $tokenProviderMock = $this->getMockBuilder(IAuthTokenProvider::class)->getMock();
 
                // expect one call per user and ensure the correct client name