aboutsummaryrefslogtreecommitdiffstats
path: root/apps/twofactor_backupcodes/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-07-23 14:32:58 +0200
committerMorris Jobke <hey@morrisjobke.de>2020-07-23 14:32:58 +0200
commit49f33ee632c3815313f084fa4251a071189b3a7e (patch)
tree403d6d23775c34d093ad54fce9555cbd3de73996 /apps/twofactor_backupcodes/tests
parent99d0ba5f7ea45bb636cfcfc2de144e25af88b916 (diff)
downloadnextcloud-server-49f33ee632c3815313f084fa4251a071189b3a7e.tar.gz
nextcloud-server-49f33ee632c3815313f084fa4251a071189b3a7e.zip
Fix risky test in twofactor_backupcodes
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/twofactor_backupcodes/tests')
-rw-r--r--apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php b/apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php
index ae5a10232e9..489ca74f3c6 100644
--- a/apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php
+++ b/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));
}
}