Browse Source
Merge pull request #21973 from nextcloud/techdebt/noid/fix-risky-2fa-backup-code-test
Fix risky test in twofactor_backupcodes
pull/21747/head
Morris Jobke
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
0 deletions
-
apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php
|
|
|
@ -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)); |
|
|
|
} |
|
|
|
} |