summaryrefslogtreecommitdiffstats
path: root/apps/encryption/tests/Settings/AdminTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/encryption/tests/Settings/AdminTest.php')
-rw-r--r--apps/encryption/tests/Settings/AdminTest.php21
1 files changed, 12 insertions, 9 deletions
diff --git a/apps/encryption/tests/Settings/AdminTest.php b/apps/encryption/tests/Settings/AdminTest.php
index 78ea6158fd2..d86c867d44d 100644
--- a/apps/encryption/tests/Settings/AdminTest.php
+++ b/apps/encryption/tests/Settings/AdminTest.php
@@ -74,20 +74,23 @@ class AdminTest extends TestCase {
public function testGetForm() {
$this->config
- ->expects($this->at(0))
->method('getAppValue')
- ->with('encryption', 'recoveryAdminEnabled', '0')
- ->willReturn(1);
- $this->config
- ->expects($this->at(1))
- ->method('getAppValue')
- ->with('encryption', 'encryptHomeStorage', '1')
- ->willReturn(1);
+ ->will($this->returnCallback(function ($app, $key, $default) {
+ if ($app === 'encryption') {
+ if ($key === 'recoveryAdminEnabled') {
+ return 1;
+ }
+ if ($key === 'encryptHomeStorage') {
+ return 1;
+ }
+ }
+ return $default;
+ }));
$params = [
'recoveryEnabled' => 1,
'initStatus' => '0',
'encryptHomeStorage' => false,
- 'masterKeyEnabled' => false
+ 'masterKeyEnabled' => true
];
$expected = new TemplateResponse('encryption', 'settings-admin', $params, '');
$this->assertEquals($expected, $this->admin->getForm());