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
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;
}
*/
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
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');
$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'));
-// }
}
//
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');
$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;
}