summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-04-02 18:12:20 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-07 13:30:31 +0200
commit870c53ee37a406d60d8cb6b319a19a3f423dda9c (patch)
tree89d7975b8cb3bb0cda37fcb5da019a9f8e17b779 /tests
parent111fbabfb4772310cfae7037dfc3b71dcb881cc5 (diff)
downloadnextcloud-server-870c53ee37a406d60d8cb6b319a19a3f423dda9c.tar.gz
nextcloud-server-870c53ee37a406d60d8cb6b319a19a3f423dda9c.zip
fixing unit test execution
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/storage/wrapper/encryption.php19
1 files changed, 12 insertions, 7 deletions
diff --git a/tests/lib/files/storage/wrapper/encryption.php b/tests/lib/files/storage/wrapper/encryption.php
index 9f681a34298..41bd2f84996 100644
--- a/tests/lib/files/storage/wrapper/encryption.php
+++ b/tests/lib/files/storage/wrapper/encryption.php
@@ -2,13 +2,13 @@
namespace Test\Files\Storage\Wrapper;
+use OC\Files\Storage\Temporary;
use OC\Files\View;
-use OCA\Encryption_Dummy\DummyModule;
class Encryption extends \Test\Files\Storage\Storage {
/**
- * @var \OC\Files\Storage\Temporary
+ * @var Temporary
*/
private $sourceStorage;
@@ -19,10 +19,7 @@ class Encryption extends \Test\Files\Storage\Storage {
$mockModule = $this->buildMockModule();
$encryptionManager = $this->getMockBuilder('\OC\Encryption\Manager')
->disableOriginalConstructor()
- ->setMethods(['getDefaultEncryptionModule', 'getEncryptionModule'])
- ->getMock();
- $config = $this->getMockBuilder('\OCP\IConfig')
- ->disableOriginalConstructor()
+ ->setMethods(['getDefaultEncryptionModule', 'getEncryptionModule', 'isEnabled'])
->getMock();
$encryptionManager->expects($this->any())
->method('getDefaultEncryptionModule')
@@ -30,6 +27,13 @@ class Encryption extends \Test\Files\Storage\Storage {
$encryptionManager->expects($this->any())
->method('getEncryptionModule')
->willReturn($mockModule);
+ $encryptionManager->expects($this->any())
+ ->method('isEnabled')
+ ->willReturn(true);
+
+ $config = $this->getMockBuilder('\OCP\IConfig')
+ ->disableOriginalConstructor()
+ ->getMock();
$util = $this->getMock('\OC\Encryption\Util', ['getUidAndFilename'], [new View(), new \OC\User\Manager(), $config]);
$util->expects($this->any())
@@ -37,13 +41,14 @@ class Encryption extends \Test\Files\Storage\Storage {
->willReturnCallback(function ($path) {
return ['user1', $path];
});
+
$file = $this->getMockBuilder('\OC\Encryption\File')
->disableOriginalConstructor()
->getMock();
$logger = $this->getMock('\OC\Log');
- $this->sourceStorage = new \OC\Files\Storage\Temporary(array());
+ $this->sourceStorage = new Temporary(array());
$keyStore = $this->getMockBuilder('\OC\Encryption\Keys\Storage')
->disableOriginalConstructor()->getMock();
$this->instance = new EncryptionWrapper([