aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-05-12 16:30:39 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-05-12 16:30:39 +0200
commite0dd69e4e605b7f4a2af4cdc8a15a8dfc1c0902a (patch)
tree53b6bd2d3da029e3476a95fe7373d0debca7d302 /apps/files_encryption/tests
parent33987eea8302e5b8f7889c934debdc2b9dd0296c (diff)
downloadnextcloud-server-e0dd69e4e605b7f4a2af4cdc8a15a8dfc1c0902a.tar.gz
nextcloud-server-e0dd69e4e605b7f4a2af4cdc8a15a8dfc1c0902a.zip
remove legacy aka deprecated code: OC_FilesystemView
Diffstat (limited to 'apps/files_encryption/tests')
-rwxr-xr-xapps/files_encryption/tests/crypt.php8
-rw-r--r--apps/files_encryption/tests/hooks.php8
-rw-r--r--apps/files_encryption/tests/keymanager.php6
-rw-r--r--apps/files_encryption/tests/proxy.php6
-rwxr-xr-xapps/files_encryption/tests/share.php8
-rw-r--r--apps/files_encryption/tests/stream.php4
-rwxr-xr-xapps/files_encryption/tests/trashbin.php4
-rwxr-xr-xapps/files_encryption/tests/util.php12
-rwxr-xr-xapps/files_encryption/tests/webdav.php4
9 files changed, 30 insertions, 30 deletions
diff --git a/apps/files_encryption/tests/crypt.php b/apps/files_encryption/tests/crypt.php
index 123943ea26a..83c2ab30b8e 100755
--- a/apps/files_encryption/tests/crypt.php
+++ b/apps/files_encryption/tests/crypt.php
@@ -34,7 +34,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
public $dataUrl;
public $dataShort;
/**
- * @var OC_FilesystemView
+ * @var OC\Files\View
*/
public $view;
public $legacyEncryptedData;
@@ -79,7 +79,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
$this->genPublicKey = $keypair['publicKey'];
$this->genPrivateKey = $keypair['privateKey'];
- $this->view = new \OC_FilesystemView('/');
+ $this->view = new \OC\Files\View('/');
// remember files_trashbin state
$this->stateFilesTrashbin = OC_App::isEnabled('files_trashbin');
@@ -157,7 +157,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
$filename = 'tmp-' . uniqid() . '.test';
- $util = new Encryption\Util(new \OC_FilesystemView(), $this->userId);
+ $util = new Encryption\Util(new \OC\Files\View(), $this->userId);
$cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/'. $filename, $this->dataShort);
@@ -216,7 +216,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
// Generate a a random filename
$filename = 'tmp-' . uniqid() . '.test';
- $util = new Encryption\Util(new \OC_FilesystemView(), $this->userId);
+ $util = new Encryption\Util(new \OC\Files\View(), $this->userId);
// Save long data as encrypted file using stream wrapper
$cryptedFile = file_put_contents('crypt:///' . $this->userId . '/files/' . $filename, $this->dataLong . $this->dataLong);
diff --git a/apps/files_encryption/tests/hooks.php b/apps/files_encryption/tests/hooks.php
index 047084ca2c1..ee534f708c2 100644
--- a/apps/files_encryption/tests/hooks.php
+++ b/apps/files_encryption/tests/hooks.php
@@ -40,7 +40,7 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
const TEST_ENCRYPTION_HOOKS_USER2 = "test-encryption-hooks-user2";
/**
- * @var \OC_FilesystemView
+ * @var \OC\Files\View
*/
public $user1View; // view on /data/user1/files
public $user2View; // view on /data/user2/files
@@ -83,9 +83,9 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
\OC_User::setUserId(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1);
// init filesystem view
- $this->user1View = new \OC_FilesystemView('/'. \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1 . '/files');
- $this->user2View = new \OC_FilesystemView('/'. \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2 . '/files');
- $this->rootView = new \OC_FilesystemView('/');
+ $this->user1View = new \OC\Files\View('/'. \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1 . '/files');
+ $this->user2View = new \OC\Files\View('/'. \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2 . '/files');
+ $this->rootView = new \OC\Files\View('/');
// init short data
$this->data = 'hats';
diff --git a/apps/files_encryption/tests/keymanager.php b/apps/files_encryption/tests/keymanager.php
index 0caf12e91a3..2bd2ddc8e68 100644
--- a/apps/files_encryption/tests/keymanager.php
+++ b/apps/files_encryption/tests/keymanager.php
@@ -29,7 +29,7 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
public $pass;
public $stateFilesTrashbin;
/**
- * @var OC_FilesystemView
+ * @var OC\Files\View
*/
public $view;
public $randomKey;
@@ -68,7 +68,7 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
$this->genPublicKey = $keypair['publicKey'];
$this->genPrivateKey = $keypair['privateKey'];
- $this->view = new \OC_FilesystemView('/');
+ $this->view = new \OC\Files\View('/');
\OC_User::setUserId(\Test_Encryption_Keymanager::TEST_USER);
$this->userId = \Test_Encryption_Keymanager::TEST_USER;
@@ -257,4 +257,4 @@ class TestProtectedKeymanagerMethods extends \OCA\Encryption\Keymanager {
public static function testGetFilenameFromShareKey($sharekey) {
return self::getFilenameFromShareKey($sharekey);
}
-} \ No newline at end of file
+}
diff --git a/apps/files_encryption/tests/proxy.php b/apps/files_encryption/tests/proxy.php
index 647ee955eb1..533aaa376b9 100644
--- a/apps/files_encryption/tests/proxy.php
+++ b/apps/files_encryption/tests/proxy.php
@@ -42,7 +42,7 @@ class Test_Encryption_Proxy extends \PHPUnit_Framework_TestCase {
public $userId;
public $pass;
/**
- * @var \OC_FilesystemView
+ * @var \OC\Files\View
*/
public $view; // view in /data/user/files
public $rootView; // view on /data/user
@@ -75,8 +75,8 @@ class Test_Encryption_Proxy extends \PHPUnit_Framework_TestCase {
$this->pass = \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1;
// init filesystem view
- $this->view = new \OC_FilesystemView('/'. \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 . '/files');
- $this->rootView = new \OC_FilesystemView('/'. \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 );
+ $this->view = new \OC\Files\View('/'. \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 . '/files');
+ $this->rootView = new \OC\Files\View('/'. \Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1 );
// init short data
$this->data = 'hats';
diff --git a/apps/files_encryption/tests/share.php b/apps/files_encryption/tests/share.php
index 512671c5767..f75092f5436 100755
--- a/apps/files_encryption/tests/share.php
+++ b/apps/files_encryption/tests/share.php
@@ -48,7 +48,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
public $filename;
public $dataShort;
/**
- * @var OC_FilesystemView
+ * @var OC\Files\View
*/
public $view;
public $folder1;
@@ -92,7 +92,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
function setUp() {
$this->dataShort = 'hats';
- $this->view = new \OC_FilesystemView('/');
+ $this->view = new \OC\Files\View('/');
$this->folder1 = '/folder1';
$this->subfolder = '/subfolder1';
@@ -669,7 +669,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
// login as admin
\Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
- $util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
+ $util = new \OCA\Encryption\Util(new \OC\Files\View('/'), \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
// check if recovery password match
$this->assertTrue($util->checkRecoveryPassword('test123'));
@@ -777,7 +777,7 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
// login as user2
\Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2);
- $util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2);
+ $util = new \OCA\Encryption\Util(new \OC\Files\View('/'), \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2);
// enable recovery for admin
$this->assertTrue($util->setRecoveryForUser(1));
diff --git a/apps/files_encryption/tests/stream.php b/apps/files_encryption/tests/stream.php
index fed2e7d89d1..f742cd3f8e9 100644
--- a/apps/files_encryption/tests/stream.php
+++ b/apps/files_encryption/tests/stream.php
@@ -42,7 +42,7 @@ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase {
public $userId;
public $pass;
/**
- * @var \OC_FilesystemView
+ * @var \OC\Files\View
*/
public $view;
public $dataShort;
@@ -71,7 +71,7 @@ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase {
$this->pass = \Test_Encryption_Stream::TEST_ENCRYPTION_STREAM_USER1;
// init filesystem view
- $this->view = new \OC_FilesystemView('/');
+ $this->view = new \OC\Files\View('/');
// init short data
$this->dataShort = 'hats';
diff --git a/apps/files_encryption/tests/trashbin.php b/apps/files_encryption/tests/trashbin.php
index 2f9ecfd9d5d..e36293ba81e 100755
--- a/apps/files_encryption/tests/trashbin.php
+++ b/apps/files_encryption/tests/trashbin.php
@@ -43,7 +43,7 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase {
public $userId;
public $pass;
/**
- * @var \OC_FilesystemView
+ * @var \OC\Files\View
*/
public $view;
public $dataShort;
@@ -81,7 +81,7 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase {
$this->pass = \Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1;
// init filesystem view
- $this->view = new \OC_FilesystemView('/');
+ $this->view = new \OC\Files\View('/');
// init short data
$this->dataShort = 'hats';
diff --git a/apps/files_encryption/tests/util.php b/apps/files_encryption/tests/util.php
index 88ded7ec40a..de83f6bca2b 100755
--- a/apps/files_encryption/tests/util.php
+++ b/apps/files_encryption/tests/util.php
@@ -29,7 +29,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
public $publicKeyDir;
public $pass;
/**
- * @var OC_FilesystemView
+ * @var OC\Files\View
*/
public $view;
public $keyfilesPath;
@@ -92,7 +92,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
$this->privateKeyPath =
$this->encryptionDir . '/' . $this->userId . '.private.key'; // e.g. data/admin/admin.private.key
- $this->view = new \OC_FilesystemView('/');
+ $this->view = new \OC\Files\View('/');
$this->util = new Encryption\Util($this->view, $this->userId);
@@ -205,7 +205,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
function testIsLegacyUser() {
\Test_Encryption_Util::loginHelper(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER);
- $userView = new \OC_FilesystemView('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER);
+ $userView = new \OC\Files\View('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER);
// Disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
@@ -384,7 +384,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
$params = array('uid' => \OCP\User::getUser(),
'password' => \OCP\User::getUser());
- $view = new OC_FilesystemView('/');
+ $view = new OC\Files\View('/');
$util = new \OCA\Encryption\Util($view, \OCP\User::getUser());
$result = $util->initEncryption($params);
@@ -496,8 +496,8 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
function testEncryptLegacyFiles() {
\Test_Encryption_Util::loginHelper(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER);
- $userView = new \OC_FilesystemView('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER);
- $view = new \OC_FilesystemView('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER . '/files');
+ $userView = new \OC\Files\View('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER);
+ $view = new \OC\Files\View('/' . \Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER . '/files');
// Disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
diff --git a/apps/files_encryption/tests/webdav.php b/apps/files_encryption/tests/webdav.php
index 1fe4c13d59e..bdd3d51897b 100755
--- a/apps/files_encryption/tests/webdav.php
+++ b/apps/files_encryption/tests/webdav.php
@@ -43,7 +43,7 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase {
public $userId;
public $pass;
/**
- * @var \OC_FilesystemView
+ * @var \OC\Files\View
*/
public $view;
public $dataShort;
@@ -82,7 +82,7 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase {
$this->pass = \Test_Encryption_Webdav::TEST_ENCRYPTION_WEBDAV_USER1;
// init filesystem view
- $this->view = new \OC_FilesystemView('/');
+ $this->view = new \OC\Files\View('/');
// init short data
$this->dataShort = 'hats';