Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2021-01-22 16:09:37 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2021-01-22 16:09:37 +0300
commit99d525eb36d8e3e14dbf72f5fb66b8554dce357c (patch)
tree28ff363dba6e0e54d8fe3c2c46457fcee8a8ca85 /tests/lib/Authentication/TwoFactorAuth/ManagerTest.php
parentb28cea626857a6ffa458558c9e45d451ac6ec9a2 (diff)
Convert 2FA token type to string
The IConfig service is documented to handle its data as strings, hence this changes the code a bit to ensure we store keys as string and convert them back when reading. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests/lib/Authentication/TwoFactorAuth/ManagerTest.php')
-rw-r--r--tests/lib/Authentication/TwoFactorAuth/ManagerTest.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php
index c93b625f61a..a04e0f05f9d 100644
--- a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php
+++ b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php
@@ -420,7 +420,7 @@ class ManagerTest extends TestCase {
->willReturn(42);
$this->config->expects($this->once())
->method('deleteUserValue')
- ->with('jos', 'login_token_2fa', 42);
+ ->with('jos', 'login_token_2fa', '42');
$result = $this->manager->verifyChallenge('email', $this->user, $challenge);
@@ -515,7 +515,7 @@ class ManagerTest extends TestCase {
$this->config->method('getUserKeys')
->with('user', 'login_token_2fa')
->willReturn([
- 42
+ '42'
]);
$manager = $this->getMockBuilder(Manager::class)
@@ -588,7 +588,7 @@ class ManagerTest extends TestCase {
->willReturn(1337);
$this->config->method('setUserValue')
- ->with('ferdinand', 'login_token_2fa', 42, 1337);
+ ->with('ferdinand', 'login_token_2fa', '42', '1337');
$this->manager->prepareTwoFactorLogin($this->user, true);
@@ -618,7 +618,7 @@ class ManagerTest extends TestCase {
->willReturn(1337);
$this->config->method('setUserValue')
- ->with('ferdinand', 'login_token_2fa', 42, 1337);
+ ->with('ferdinand', 'login_token_2fa', '42', '1337');
$this->manager->prepareTwoFactorLogin($this->user, false);
}
@@ -666,7 +666,7 @@ class ManagerTest extends TestCase {
$this->config->method('getUserKeys')
->with('user', 'login_token_2fa')
->willReturn([
- 42, 43, 44
+ '42', '43', '44'
]);
$this->session->expects($this->once())