summaryrefslogtreecommitdiffstats
path: root/tests/lib/files/storage/wrapper/encryption.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/files/storage/wrapper/encryption.php')
-rw-r--r--tests/lib/files/storage/wrapper/encryption.php50
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/lib/files/storage/wrapper/encryption.php b/tests/lib/files/storage/wrapper/encryption.php
new file mode 100644
index 00000000000..b8d4e962c54
--- /dev/null
+++ b/tests/lib/files/storage/wrapper/encryption.php
@@ -0,0 +1,50 @@
+<?php
+
+namespace Test\Files\Storage\Wrapper;
+
+use OC\Files\View;
+use OCA\Encryption_Dummy\DummyModule;
+
+class Encryption extends \Test\Files\Storage\Storage {
+
+ /**
+ * @var \OC\Files\Storage\Temporary
+ */
+ private $sourceStorage;
+
+ public function setUp() {
+
+ parent::setUp();
+
+ $encryptionManager = $this->getMockBuilder('\OC\Encryption\Manager')
+ ->disableOriginalConstructor()
+ ->setMethods(['getDefaultEncryptionModule', 'getEncryptionModule'])
+ ->getMock();
+ $encryptionManager->expects($this->any())
+ ->method('getDefaultEncryptionModule')
+ ->willReturn(new DummyModule());
+
+ $util = new \OC\Encryption\Util(new View(), new \OC\User\Manager());
+
+ $logger = $this->getMock('\OC\Log');
+
+ $this->sourceStorage = new \OC\Files\Storage\Temporary(array());
+ $this->instance = new \OC\Files\Storage\Wrapper\Encryption([
+ 'storage' => $this->sourceStorage,
+ 'root' => 'foo',
+ 'mountPoint' => '/'
+ ],
+ $encryptionManager, $util, $logger
+ );
+ }
+
+// public function testMkDirRooted() {
+// $this->instance->mkdir('bar');
+// $this->assertTrue($this->sourceStorage->is_dir('foo/bar'));
+// }
+//
+// public function testFilePutContentsRooted() {
+// $this->instance->file_put_contents('bar', 'asd');
+// $this->assertEquals('asd', $this->sourceStorage->file_get_contents('foo/bar'));
+// }
+}