diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-09-18 08:53:02 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-09-18 08:55:59 +0200 |
commit | 2f102c1f0d2fc93d1d9091297b0cb920fc8947de (patch) | |
tree | ca9e50faa00a67bf581b354731f64d59a0ec9b89 /tests/core/command | |
parent | 2eeb1b2b793bae0259874af80e6a5bb99dc224d7 (diff) | |
download | nextcloud-server-2f102c1f0d2fc93d1d9091297b0cb920fc8947de.tar.gz nextcloud-server-2f102c1f0d2fc93d1d9091297b0cb920fc8947de.zip |
Do not set single user in constructor
Diffstat (limited to 'tests/core/command')
-rw-r--r-- | tests/core/command/encryption/decryptalltest.php | 7 | ||||
-rw-r--r-- | tests/core/command/encryption/encryptalltest.php | 4 |
2 files changed, 8 insertions, 3 deletions
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'); } /** |