From 8a401ee15687059836c93dda62ee5ea3fbf800cf Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Wed, 23 Nov 2016 12:07:04 +0100 Subject: check if session is initialized Signed-off-by: Bjoern Schiessle --- apps/encryption/tests/Crypto/EncryptionTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'apps/encryption/tests/Crypto/EncryptionTest.php') diff --git a/apps/encryption/tests/Crypto/EncryptionTest.php b/apps/encryption/tests/Crypto/EncryptionTest.php index 658f6275bb4..3525d2d4aec 100644 --- a/apps/encryption/tests/Crypto/EncryptionTest.php +++ b/apps/encryption/tests/Crypto/EncryptionTest.php @@ -279,6 +279,21 @@ class EncryptionTest extends TestCase { ); } + /** + * test begin() if encryption is not initialized but the master key is enabled + * in this case we can initialize the encryption without a username/password + * and continue + */ + public function testBeginInitMasterKey() { + + $this->sessionMock->expects($this->once())->method('isReady')->willReturn(false); + $this->utilMock->expects($this->once())->method('isMasterKeyEnabled') + ->willReturn(true); + $this->keyManagerMock->expects($this->once())->method('init')->with('', ''); + + $this->instance->begin('/user/files/welcome.txt', 'user', 'r', [], []); + } + /** * @dataProvider dataTestUpdate * -- cgit v1.2.3