Skip to content

Commit f8955bd

Browse files
authored
Merge pull request #21973 from nextcloud/techdebt/noid/fix-risky-2fa-backup-code-test
Fix risky test in twofactor_backupcodes
2 parents cdf095d + 49f33ee commit f8955bd

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,12 @@ public function testInsertArgonEncryptedCodes() {
117117
$code->setUserId($this->testUID);
118118
$code->setCode('2|$argon2i$v=19$m=1024,t=2,p=2$MjJWUjRFWndtMm5BWGxOag$BusVxLeFyiLLWtaVvX/JRFBiPdZcjRrzpQ/rAhn6vqY');
119119
$code->setUsed(1);
120+
$user = $this->getMockBuilder(IUser::class)->getMock();
121+
$user->expects($this->any())
122+
->method('getUID')
123+
->willReturn($this->testUID);
120124

121125
$this->mapper->insert($code);
126+
$this->assertCount(1, $this->mapper->getBackupCodes($user));
122127
}
123128
}

0 commit comments

Comments
 (0)