diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2015-10-13 17:54:06 +0200 |
---|---|---|
committer | Björn Schießle <bjoern@schiessle.org> | 2015-10-27 14:24:20 +0100 |
commit | 5fad45b2309426c5b91af1d87beaa9950eadc5ba (patch) | |
tree | 0c45e969b3a5b457c47169ff540df82f46ae14b3 /apps/encryption/tests/controller | |
parent | d7d5a3bab51d952e05965e84b784d7eff0efc9c9 (diff) | |
download | nextcloud-server-5fad45b2309426c5b91af1d87beaa9950eadc5ba.tar.gz nextcloud-server-5fad45b2309426c5b91af1d87beaa9950eadc5ba.zip |
make encryption configurable for home storage
Diffstat (limited to 'apps/encryption/tests/controller')
-rw-r--r-- | apps/encryption/tests/controller/SettingsControllerTest.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/apps/encryption/tests/controller/SettingsControllerTest.php b/apps/encryption/tests/controller/SettingsControllerTest.php index 724a01522af..3b30e61a45b 100644 --- a/apps/encryption/tests/controller/SettingsControllerTest.php +++ b/apps/encryption/tests/controller/SettingsControllerTest.php @@ -56,6 +56,9 @@ class SettingsControllerTest extends TestCase { /** @var \PHPUnit_Framework_MockObject_MockObject */ private $ocSessionMock; + /** @var \PHPUnit_Framework_MockObject_MockObject */ + private $utilMock; + protected function setUp() { parent::setUp(); @@ -106,6 +109,10 @@ class SettingsControllerTest extends TestCase { $this->sessionMock = $this->getMockBuilder('OCA\Encryption\Session') ->disableOriginalConstructor()->getMock(); + $this->utilMock = $this->getMockBuilder('OCA\Encryption\Util') + ->disableOriginalConstructor() + ->getMock(); + $this->controller = new SettingsController( 'encryption', $this->requestMock, @@ -115,7 +122,8 @@ class SettingsControllerTest extends TestCase { $this->keyManagerMock, $this->cryptMock, $this->sessionMock, - $this->ocSessionMock + $this->ocSessionMock, + $this->utilMock ); } @@ -234,4 +242,10 @@ class SettingsControllerTest extends TestCase { $data['message']); } + function testSetEncryptHomeStorage() { + $value = true; + $this->utilMock->expects($this->once())->method('setEncryptHomeStorage')->with($value); + $this->controller->setEncryptHomeStorage($value); + } + } |