From 2f102c1f0d2fc93d1d9091297b0cb920fc8947de Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 18 Sep 2015 08:53:02 +0200 Subject: Do not set single user in constructor --- tests/core/command/encryption/decryptalltest.php | 7 +++++-- tests/core/command/encryption/encryptalltest.php | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'tests/core') diff --git a/tests/core/command/encryption/decryptalltest.php b/tests/core/command/encryption/decryptalltest.php index ef36d6d2827..972ea03150c 100644 --- a/tests/core/command/encryption/decryptalltest.php +++ b/tests/core/command/encryption/decryptalltest.php @@ -79,7 +79,8 @@ class DecryptAllTest extends TestCase { } - public function testConstructDesctruct() { + public function testSingleUserAndTrashbin() { + // on construct we enable single-user-mode and disable the trash bin $this->config->expects($this->at(1)) ->method('setSystemValue') @@ -103,6 +104,7 @@ class DecryptAllTest extends TestCase { $this->decryptAll, $this->questionHelper ); + $this->invokePrivate($instance, 'forceSingleUserAndTrashbin'); $this->assertTrue( $this->invokePrivate($instance, 'wasTrashbinEnabled') @@ -111,6 +113,7 @@ class DecryptAllTest extends TestCase { $this->assertFalse( $this->invokePrivate($instance, 'wasSingleUserModeEnabled') ); + $this->invokePrivate($instance, 'resetSingleUserAndTrashbin'); } /** @@ -187,7 +190,7 @@ class DecryptAllTest extends TestCase { ->with('core', 'encryption_enabled', 'no'); // make sure that we enable encryption again after a exception was thrown - $this->config->expects($this->at(1)) + $this->config->expects($this->at(3)) ->method('setAppValue') ->with('core', 'encryption_enabled', 'yes'); diff --git a/tests/core/command/encryption/encryptalltest.php b/tests/core/command/encryption/encryptalltest.php index 9f7f7375044..128b4caa148 100644 --- a/tests/core/command/encryption/encryptalltest.php +++ b/tests/core/command/encryption/encryptalltest.php @@ -85,7 +85,9 @@ class EncryptAllTest extends TestCase { $this->config->expects($this->at(1))->method('setSystemValue')->with('singleuser', true); $this->config->expects($this->at(2))->method('setSystemValue')->with('singleuser', false); - new EncryptAll($this->encryptionManager, $this->appManager, $this->config, $this->questionHelper); + $instance = new EncryptAll($this->encryptionManager, $this->appManager, $this->config, $this->questionHelper); + $this->invokePrivate($instance, 'forceSingleUserAndTrashbin'); + $this->invokePrivate($instance, 'resetSingleUserAndTrashbin'); } /** -- cgit v1.2.3