diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2016-03-30 23:20:37 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2016-03-31 19:24:47 +0200 |
commit | 93ed965cbb1952faafc1ca5e09ee0de84d122c05 (patch) | |
tree | 2631e5302305b9b59b25b006edca19650ca2a1bc /tests/lib/encryption/utiltest.php | |
parent | 8ef6c6c7bcf0b58561aee6ec1a18ea7a8643a773 (diff) | |
download | nextcloud-server-93ed965cbb1952faafc1ca5e09ee0de84d122c05.tar.gz nextcloud-server-93ed965cbb1952faafc1ca5e09ee0de84d122c05.zip |
fix creation of versions of encrypted files on external storages
in order to create a 1:1 copy of a file if a version gets created
we need to store this information on copyBetweenStorage(). This
allows us to by-pass the encryption wrapper if we read the source file.
Diffstat (limited to 'tests/lib/encryption/utiltest.php')
-rw-r--r-- | tests/lib/encryption/utiltest.php | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/tests/lib/encryption/utiltest.php b/tests/lib/encryption/utiltest.php index 449326bb351..ec316a9f05a 100644 --- a/tests/lib/encryption/utiltest.php +++ b/tests/lib/encryption/utiltest.php @@ -188,49 +188,4 @@ class UtilTest extends TestCase { ); } - /** - * @dataProvider provideWrapStorage - */ - public function testWrapStorage($expectedWrapped, $wrappedStorages) { - $storage = $this->getMockBuilder('OC\Files\Storage\Storage') - ->disableOriginalConstructor() - ->getMock(); - - foreach ($wrappedStorages as $wrapper) { - $storage->expects($this->any()) - ->method('instanceOfStorage') - ->willReturnMap([ - [$wrapper, true], - ]); - } - - $mount = $this->getMockBuilder('OCP\Files\Mount\IMountPoint') - ->disableOriginalConstructor() - ->getMock(); - - $returnedStorage = $this->util->wrapStorage('mountPoint', $storage, $mount); - - $this->assertEquals( - $expectedWrapped, - $returnedStorage->instanceOfStorage('OC\Files\Storage\Wrapper\Encryption'), - 'Asserted that the storage is (not) wrapped with encryption' - ); - } - - public function provideWrapStorage() { - return [ - // Wrap when not wrapped or not wrapped with storage - [true, []], - [true, ['OCA\Files_Trashbin\Storage']], - - // Do not wrap shared storages - [false, ['OC\Files\Storage\Shared']], - [false, ['OCA\Files_Sharing\External\Storage']], - [false, ['OC\Files\Storage\OwnCloud']], - [false, ['OC\Files\Storage\Shared', 'OCA\Files_Sharing\External\Storage']], - [false, ['OC\Files\Storage\Shared', 'OC\Files\Storage\OwnCloud']], - [false, ['OCA\Files_Sharing\External\Storage', 'OC\Files\Storage\OwnCloud']], - [false, ['OC\Files\Storage\Shared', 'OCA\Files_Sharing\External\Storage', 'OC\Files\Storage\OwnCloud']], - ]; - } } |