From 391a368557b18a89c79406d366e578530e36fe36 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 29 Jan 2020 10:42:11 +0100 Subject: Move the personal 2FA settings to its own app Small isolated classes are easier to understand and to maintain! Another step in the cleaning up of the settings. So that adding new stuff later is easier. Signed-off-by: Roeland Jago Douma --- .../tests/Settings/Personal/SecurityTest.php | 35 ---------------------- 1 file changed, 35 deletions(-) (limited to 'apps/settings/tests') diff --git a/apps/settings/tests/Settings/Personal/SecurityTest.php b/apps/settings/tests/Settings/Personal/SecurityTest.php index bd087afa466..103bd9dae92 100644 --- a/apps/settings/tests/Settings/Personal/SecurityTest.php +++ b/apps/settings/tests/Settings/Personal/SecurityTest.php @@ -43,15 +43,6 @@ class SecurityTest extends TestCase { /** @var IUserManager|MockObject */ private $userManager; - /** @var ProviderLoader|MockObject */ - private $providerLoader; - - /** @var IUserSession|MockObject */ - private $userSession; - - /** @var IConfig|MockObject */ - private $config; - /** @var string */ private $uid; @@ -62,16 +53,10 @@ class SecurityTest extends TestCase { parent::setUp(); $this->userManager = $this->createMock(IUserManager::class); - $this->providerLoader = $this->createMock(ProviderLoader::class); - $this->userSession = $this->createMock(IUserSession::class); - $this->config = $this->createMock(IConfig::class); $this->uid = 'test123'; $this->section = new Security( $this->userManager, - $this->providerLoader, - $this->userSession, - $this->config, $this->uid ); } @@ -85,31 +70,11 @@ class SecurityTest extends TestCase { $user->expects($this->once()) ->method('canChangePassword') ->willReturn(true); - $this->userSession->expects($this->once()) - ->method('getUser') - ->willReturn($user); - $this->providerLoader->expects($this->once()) - ->method('getProviders') - ->with($user) - ->willReturn([]); - $this->config->expects($this->once()) - ->method('getUserValue') - ->with( - $this->uid, - 'accessibility', - 'theme', - false - ) - ->willReturn(false); $form = $this->section->getForm(); $expected = new TemplateResponse('settings', 'settings/personal/security', [ 'passwordChangeSupported' => true, - 'twoFactorProviderData' => [ - 'providers' => [], - ], - 'themedark' => false, ]); $this->assertEquals($expected, $form); } -- cgit v1.2.3