diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2018-10-11 12:20:18 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2018-10-15 08:22:52 +0200 |
commit | 83e994c11fcc25a525e604bf7cc100f574794e02 (patch) | |
tree | 7ee44e5ad7bee886e98d7d6f14a4805bc16da611 /tests/Settings | |
parent | 82a5833217d8fb1a74e7838b3e2ccf2cb9e1b90c (diff) | |
download | nextcloud-server-83e994c11fcc25a525e604bf7cc100f574794e02.tar.gz nextcloud-server-83e994c11fcc25a525e604bf7cc100f574794e02.zip |
Make it possible to enforce mandatory 2FA for groups
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests/Settings')
-rw-r--r-- | tests/Settings/Controller/TwoFactorSettingsControllerTest.php | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/tests/Settings/Controller/TwoFactorSettingsControllerTest.php b/tests/Settings/Controller/TwoFactorSettingsControllerTest.php index 353fc759425..6872d4e2152 100644 --- a/tests/Settings/Controller/TwoFactorSettingsControllerTest.php +++ b/tests/Settings/Controller/TwoFactorSettingsControllerTest.php @@ -22,6 +22,7 @@ namespace Tests\Settings\Controller; +use OC\Authentication\TwoFactorAuth\EnforcementState; use OC\Authentication\TwoFactorAuth\MandatoryTwoFactor; use OC\Settings\Controller\TwoFactorSettingsController; use OCP\AppFramework\Http\JSONResponse; @@ -54,12 +55,11 @@ class TwoFactorSettingsControllerTest extends TestCase { } public function testIndex() { + $state = new EnforcementState(true); $this->mandatoryTwoFactor->expects($this->once()) - ->method('isEnforced') - ->willReturn(true); - $expected = new JSONResponse([ - 'enabled' => true, - ]); + ->method('getState') + ->willReturn($state); + $expected = new JSONResponse($state); $resp = $this->controller->index(); @@ -67,12 +67,14 @@ class TwoFactorSettingsControllerTest extends TestCase { } public function testUpdate() { + $state = new EnforcementState(true); $this->mandatoryTwoFactor->expects($this->once()) - ->method('setEnforced') - ->with(true); - $expected = new JSONResponse([ - 'enabled' => true, - ]); + ->method('setState') + ->with($this->equalTo(new EnforcementState(true))); + $this->mandatoryTwoFactor->expects($this->once()) + ->method('getState') + ->willReturn($state); + $expected = new JSONResponse($state); $resp = $this->controller->update(true); |