Skip to content

Commit 56963ce

Browse files
authored
Merge pull request #21980 from nextcloud/backport/21973/stable17
[stable17] Fix risky test in twofactor_backupcodes
2 parents eee93ac + 6777f6d commit 56963ce

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
@@ -114,8 +114,13 @@ public function testInsertArgonEncryptedCodes() {
114114
$code->setUserId($this->testUID);
115115
$code->setCode('2|$argon2i$v=19$m=1024,t=2,p=2$MjJWUjRFWndtMm5BWGxOag$BusVxLeFyiLLWtaVvX/JRFBiPdZcjRrzpQ/rAhn6vqY');
116116
$code->setUsed(1);
117+
$user = $this->getMockBuilder(IUser::class)->getMock();
118+
$user->expects($this->any())
119+
->method('getUID')
120+
->willReturn($this->testUID);
117121

118122
$this->mapper->insert($code);
123+
$this->assertCount(1, $this->mapper->getBackupCodes($user));
119124
}
120125

121126
}

0 commit comments

Comments
 (0)