From 2701e76cfe5e9b34cef2406eff9cd6157513a75a Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Thu, 23 Jul 2020 14:32:58 +0200 Subject: [PATCH] Fix risky test in twofactor_backupcodes Signed-off-by: Morris Jobke --- apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php b/apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php index 136a734aa81..c58e1930820 100644 --- a/apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php +++ b/apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php @@ -117,8 +117,13 @@ 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)); } } -- 2.39.5