]> source.dussan.org Git - nextcloud-server.git/commitdiff
remove calculateUnencryptedSize() - not needed
authorThomas Müller <thomas.mueller@tmit.eu>
Tue, 14 Apr 2015 10:53:13 +0000 (12:53 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Tue, 14 Apr 2015 11:08:59 +0000 (13:08 +0200)
apps/encryption/lib/crypto/encryption.php
apps/encryption_dummy/lib/dummymodule.php
lib/public/encryption/iencryptionmodule.php
tests/lib/files/storage/wrapper/encryption.php
tests/lib/files/stream/encryption.php

index 13beda196ce8b8ea7dd7b79ddde09f78125cd581..fd5a84c9734fcb83e753636c1475b7242d3e22a7 100644 (file)
@@ -308,16 +308,6 @@ class Encryption implements IEncryptionModule {
                return false;
        }
 
-       /**
-        * calculate unencrypted size
-        *
-        * @param string $path to file
-        * @return integer unencrypted size
-        */
-       public function calculateUnencryptedSize($path) {
-               // TODO: Implement calculateUnencryptedSize() method.
-       }
-
        /**
         * get size of the unencrypted payload per block.
         * ownCloud read/write files with a block size of 8192 byte
index b4dfe34a9bfdf1d88ed8e4389aee257c83e1bd0a..813b50edcbd6f41c0fad61b3942503c3713e4eaf 100644 (file)
@@ -119,16 +119,6 @@ class DummyModule implements IEncryptionModule {
                return false;
        }
 
-       /**
-        * calculate unencrypted size
-        *
-        * @param string $path to file
-        * @return integer unencrypted size
-        */
-       public function calculateUnencryptedSize($path) {
-               return 42;
-       }
-
        public function getUnencryptedBlockSize() {
                return 6126;
        }
index c1ce7d99d782ba93e866d5212739f817d9fb9db3..d22ca0ec86c4bcba7a85671948024bccddf408cd 100644 (file)
@@ -96,14 +96,6 @@ interface IEncryptionModule {
         */
        public function shouldEncrypt($path);
 
-       /**
-        * calculate unencrypted size
-        *
-        * @param string $path to file
-        * @return integer unencrypted size
-        */
-       public function calculateUnencryptedSize($path);
-
        /**
         * get size of the unencrypted payload per block.
         * ownCloud read/write files with a block size of 8192 byte
index 4f7a9e851c18b93ebcbf2e006828219f7ef56405..ec3770260aa13c8e17b881ab4b2aa8dcd97ae308 100644 (file)
@@ -74,7 +74,7 @@ class Encryption extends \Test\Files\Storage\Storage {
        protected function buildMockModule() {
                $encryptionModule = $this->getMockBuilder('\OCP\Encryption\IEncryptionModule')
                        ->disableOriginalConstructor()
-                       ->setMethods(['getId', 'getDisplayName', 'begin', 'end', 'encrypt', 'decrypt', 'update', 'shouldEncrypt', 'calculateUnencryptedSize', 'getUnencryptedBlockSize'])
+                       ->setMethods(['getId', 'getDisplayName', 'begin', 'end', 'encrypt', 'decrypt', 'update', 'shouldEncrypt', 'getUnencryptedBlockSize'])
                        ->getMock();
 
                $encryptionModule->expects($this->any())->method('getId')->willReturn('UNIT_TEST_MODULE');
@@ -85,20 +85,9 @@ class Encryption extends \Test\Files\Storage\Storage {
                $encryptionModule->expects($this->any())->method('decrypt')->willReturnArgument(0);
                $encryptionModule->expects($this->any())->method('update')->willReturn(true);
                $encryptionModule->expects($this->any())->method('shouldEncrypt')->willReturn(true);
-               $encryptionModule->expects($this->any())->method('calculateUnencryptedSize')->willReturn(42);
                $encryptionModule->expects($this->any())->method('getUnencryptedBlockSize')->willReturn(8192);
                return $encryptionModule;
        }
-
-//     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'));
-//     }
 }
 
 //
index 53727a2213d2afff9cef392e35a436e2562a2dd8..6964d203f1822b082c4af65b56f9a40a9f2d690e 100644 (file)
@@ -88,7 +88,7 @@ class Encryption extends \Test\TestCase {
        protected function buildMockModule() {
                $encryptionModule = $this->getMockBuilder('\OCP\Encryption\IEncryptionModule')
                        ->disableOriginalConstructor()
-                       ->setMethods(['getId', 'getDisplayName', 'begin', 'end', 'encrypt', 'decrypt', 'update', 'shouldEncrypt', 'calculateUnencryptedSize', 'getUnencryptedBlockSize'])
+                       ->setMethods(['getId', 'getDisplayName', 'begin', 'end', 'encrypt', 'decrypt', 'update', 'shouldEncrypt', 'getUnencryptedBlockSize'])
                        ->getMock();
 
                $encryptionModule->expects($this->any())->method('getId')->willReturn('UNIT_TEST_MODULE');
@@ -99,7 +99,6 @@ class Encryption extends \Test\TestCase {
                $encryptionModule->expects($this->any())->method('decrypt')->willReturnArgument(0);
                $encryptionModule->expects($this->any())->method('update')->willReturn(true);
                $encryptionModule->expects($this->any())->method('shouldEncrypt')->willReturn(true);
-               $encryptionModule->expects($this->any())->method('calculateUnencryptedSize')->willReturn(42);
                $encryptionModule->expects($this->any())->method('getUnencryptedBlockSize')->willReturn(8192);
                return $encryptionModule;
        }