]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix risky test in twofactor_backupcodes 21973/head
authorMorris Jobke <hey@morrisjobke.de>
Thu, 23 Jul 2020 12:32:58 +0000 (14:32 +0200)
committerMorris Jobke <hey@morrisjobke.de>
Thu, 23 Jul 2020 12:32:58 +0000 (14:32 +0200)
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php

index ae5a10232e90e5d6a98d0d45cd1192808e7994cb..489ca74f3c6855215d444868b5c683ef131deb41 100644 (file)
@@ -117,7 +117,12 @@ class BackupCodeMapperTest extends TestCase {
                $code->setUserId($this->testUID);
                $code->setCode('2|$argon2i$v=19$m=1024,t=2,p=2$MjJWUjRFWndtMm5BWGxOag$BusVxLeFyiLLWtaVvX/JRFBiPdZcjRrzpQ/rAhn6vqY');
                $code->setUsed(1);
+               $user = $this->getMockBuilder(IUser::class)->getMock();
+               $user->expects($this->any())
+                       ->method('getUID')
+                       ->willReturn($this->testUID);
 
                $this->mapper->insert($code);
+               $this->assertCount(1, $this->mapper->getBackupCodes($user));
        }
 }