diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2018-09-10 18:02:37 +0300 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-09-25 10:54:20 +0300 |
commit | 7586b19e524761c1e8aab5170375a0d6c9e8f7a2 (patch) | |
tree | e2a0fc5fa9754c12cfd226bf7aa48964fce18237 /tests/lib/Authentication/TwoFactorAuth/ManagerTest.php | |
parent | 92fa373314e77dc905036812253f6b776a9e1aaf (diff) |
Only allow 2FA state changs if providers support the operation
Ref https://github.com/nextcloud/server/issues/11019.
Add `twofactorauth:cleanup` command
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.php | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php index 1d7c147d9ce..301b4cc09db 100644 --- a/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php +++ b/tests/lib/Authentication/TwoFactorAuth/ManagerTest.php @@ -143,13 +143,6 @@ class ManagerTest extends TestCase { } public function testIsTwoFactorAuthenticatedNoProviders() { - $this->user->expects($this->once()) - ->method('getUID') - ->will($this->returnValue('user123')); - $this->config->expects($this->once()) - ->method('getUserValue') - ->with('user123', 'core', 'two_factor_auth_disabled', 0) - ->willReturn(0); $this->providerRegistry->expects($this->once()) ->method('getProviderStates') ->willReturn([]); // No providers registered @@ -161,13 +154,6 @@ class ManagerTest extends TestCase { } public function testIsTwoFactorAuthenticatedOnlyBackupCodes() { - $this->user->expects($this->once()) - ->method('getUID') - ->will($this->returnValue('user123')); - $this->config->expects($this->once()) - ->method('getUserValue') - ->with('user123', 'core', 'two_factor_auth_disabled', 0) - ->willReturn(0); $this->providerRegistry->expects($this->once()) ->method('getProviderStates') ->willReturn([ @@ -187,13 +173,6 @@ class ManagerTest extends TestCase { } public function testIsTwoFactorAuthenticatedFailingProviders() { - $this->user->expects($this->once()) - ->method('getUID') - ->will($this->returnValue('user123')); - $this->config->expects($this->once()) - ->method('getUserValue') - ->with('user123', 'core', 'two_factor_auth_disabled', 0) - ->willReturn(0); $this->providerRegistry->expects($this->once()) ->method('getProviderStates') ->willReturn([ @@ -225,13 +204,6 @@ class ManagerTest extends TestCase { * @dataProvider providerStatesFixData */ public function testIsTwoFactorAuthenticatedFixesProviderStates(bool $providerEnabled, bool $expected) { - $this->user->expects($this->once()) - ->method('getUID') - ->will($this->returnValue('user123')); - $this->config->expects($this->once()) - ->method('getUserValue') - ->with('user123', 'core', 'two_factor_auth_disabled', 0) - ->willReturn(0); $this->providerRegistry->expects($this->once()) ->method('getProviderStates') ->willReturn([]); // Nothing registered yet |