]> source.dussan.org Git - nextcloud-server.git/commitdiff
remove unnecessary require calls - the ownCloud class loader is supposed to take...
authorThomas Müller <thomas.mueller@tmit.eu>
Thu, 30 Oct 2014 16:20:40 +0000 (17:20 +0100)
committerThomas Müller <thomas.mueller@tmit.eu>
Thu, 30 Oct 2014 16:20:40 +0000 (17:20 +0100)
34 files changed:
apps/files/tests/helper.php
apps/files_encryption/tests/crypt.php
apps/files_encryption/tests/helper.php
apps/files_encryption/tests/hooks.php
apps/files_encryption/tests/keymanager.php
apps/files_encryption/tests/proxy.php
apps/files_encryption/tests/share.php
apps/files_encryption/tests/stream.php
apps/files_encryption/tests/trashbin.php
apps/files_encryption/tests/util.php
apps/files_encryption/tests/webdav.php
apps/files_sharing/tests/api.php
apps/files_sharing/tests/backend.php
apps/files_sharing/tests/base.php [deleted file]
apps/files_sharing/tests/cache.php
apps/files_sharing/tests/externalstorage.php
apps/files_sharing/tests/helper.php
apps/files_sharing/tests/permissions.php
apps/files_sharing/tests/proxy.php
apps/files_sharing/tests/share.php
apps/files_sharing/tests/sharedmount.php
apps/files_sharing/tests/sharedstorage.php
apps/files_sharing/tests/testcase.php [new file with mode: 0644]
apps/files_sharing/tests/update.php
apps/files_sharing/tests/updater.php
apps/files_sharing/tests/watcher.php
apps/files_trashbin/tests/trashbin.php
apps/files_versions/tests/versions.php
tests/lib/appframework/http/DownloadResponseTest.php
tests/lib/appframework/http/HttpTest.php
tests/lib/appframework/http/JSONResponseTest.php
tests/lib/appframework/http/RedirectResponseTest.php
tests/lib/archive/tar.php
tests/lib/archive/zip.php

index f269cc70ed55e7dc57df10e61197a3abb49d31f4..17be1770c338aa77319940ba61b59a6980d623cc 100644 (file)
@@ -6,8 +6,6 @@
  * See the COPYING-README file.
  */
 
-require_once __DIR__ . '/../lib/helper.php';
-
 use OCA\Files;
 
 /**
index a89754d4a1410404f2f80c131cbe09c8d2bd970c..1b8291fea289e92118a209f26fd085660b53fbe1 100755 (executable)
@@ -7,16 +7,6 @@
  * See the COPYING-README file.
  */
 
-require_once __DIR__ . '/../../../lib/base.php';
-require_once __DIR__ . '/../lib/crypt.php';
-require_once __DIR__ . '/../lib/keymanager.php';
-require_once __DIR__ . '/../lib/proxy.php';
-require_once __DIR__ . '/../lib/stream.php';
-require_once __DIR__ . '/../lib/util.php';
-require_once __DIR__ . '/../lib/helper.php';
-require_once __DIR__ . '/../appinfo/app.php';
-require_once __DIR__ . '/util.php';
-
 use OCA\Encryption;
 
 /**
index df7ff8cdb113050f7fe3b19645760da5b7e1d9c8..ed543bf89f66327ffd64beb847c1989f4aaa910d 100644 (file)
@@ -6,8 +6,6 @@
  * See the COPYING-README file.
  */
 
-
-require_once __DIR__ . '/../lib/helper.php';
 require_once __DIR__ . '/util.php';
 
 use OCA\Encryption;
index c7353deee22fb72132d54f7f4e892ee849dae838..c2434c0f5f6053adcc73ce7190e1f36828338029 100644 (file)
  *
  */
 
-require_once __DIR__ . '/../../../lib/base.php';
-require_once __DIR__ . '/../lib/crypt.php';
-require_once __DIR__ . '/../lib/keymanager.php';
-require_once __DIR__ . '/../lib/stream.php';
-require_once __DIR__ . '/../lib/util.php';
-require_once __DIR__ . '/../appinfo/app.php';
 require_once __DIR__ . '/util.php';
 
 use OCA\Encryption;
index ad7d2cfcd45f2e6b1a541829ced12f63888f89cc..e2486ee93eb9c16c424795f233f014bed9c0bdca 100644 (file)
@@ -6,14 +6,6 @@
  * See the COPYING-README file.
  */
 
-require_once __DIR__ . '/../../../lib/base.php';
-require_once __DIR__ . '/../lib/crypt.php';
-require_once __DIR__ . '/../lib/keymanager.php';
-require_once __DIR__ . '/../lib/proxy.php';
-require_once __DIR__ . '/../lib/stream.php';
-require_once __DIR__ . '/../lib/util.php';
-require_once __DIR__ . '/../lib/helper.php';
-require_once __DIR__ . '/../appinfo/app.php';
 require_once __DIR__ . '/util.php';
 
 use OCA\Encryption;
index 56d6cd2f7367d96ce2f17c661cc08ef45162bbe0..d3e568f8914d60abd97375227ed33db49cba5189 100644 (file)
  *
  */
 
-require_once __DIR__ . '/../../../lib/base.php';
-require_once __DIR__ . '/../lib/crypt.php';
-require_once __DIR__ . '/../lib/keymanager.php';
-require_once __DIR__ . '/../lib/proxy.php';
-require_once __DIR__ . '/../lib/stream.php';
-require_once __DIR__ . '/../lib/util.php';
-require_once __DIR__ . '/../appinfo/app.php';
 require_once __DIR__ . '/util.php';
 
 use OCA\Encryption;
index e640b8c1a6a3626b85481c46b9926366cd6658a4..d7efe21a8fd6c1fd7a7271d88a5838e0f0292b0e 100755 (executable)
  *
  */
 
-require_once __DIR__ . '/../../../lib/base.php';
-require_once __DIR__ . '/../lib/crypt.php';
-require_once __DIR__ . '/../lib/keymanager.php';
-require_once __DIR__ . '/../lib/proxy.php';
-require_once __DIR__ . '/../lib/stream.php';
-require_once __DIR__ . '/../lib/util.php';
-require_once __DIR__ . '/../lib/helper.php';
-require_once __DIR__ . '/../appinfo/app.php';
 require_once __DIR__ . '/util.php';
 
 use OCA\Encryption;
index b8c18fbe0490ff9263c8acb287d03734b1f4097f..2b57f11c680c825b716f90b3ff990fe037c179c5 100644 (file)
  *
  */
 
-require_once __DIR__ . '/../../../lib/base.php';
-require_once __DIR__ . '/../lib/crypt.php';
-require_once __DIR__ . '/../lib/keymanager.php';
-require_once __DIR__ . '/../lib/proxy.php';
-require_once __DIR__ . '/../lib/stream.php';
-require_once __DIR__ . '/../lib/util.php';
-require_once __DIR__ . '/../appinfo/app.php';
 require_once __DIR__ . '/util.php';
 
 use OCA\Encryption;
index 5890292cd7bc26ae69365e99ee06a543748aed2b..d795240399cb0274727d5d4409295a01ba9624ec 100755 (executable)
  *
  */
 
-require_once __DIR__ . '/../../../lib/base.php';
-require_once __DIR__ . '/../lib/crypt.php';
-require_once __DIR__ . '/../lib/keymanager.php';
-require_once __DIR__ . '/../lib/proxy.php';
-require_once __DIR__ . '/../lib/stream.php';
-require_once __DIR__ . '/../lib/util.php';
-require_once __DIR__ . '/../appinfo/app.php';
-require_once __DIR__ . '/../../files_trashbin/appinfo/app.php';
 require_once __DIR__ . '/util.php';
 
 use OCA\Encryption;
index d5bfb86a2e4f5445b94c8c6dd32b21120093cc11..210ffcc541013dabdec180f1e36b2d6ef10c8b78 100755 (executable)
@@ -6,14 +6,6 @@
  * See the COPYING-README file.
  */
 
-require_once __DIR__ . '/../../../lib/base.php';
-require_once __DIR__ . '/../lib/crypt.php';
-require_once __DIR__ . '/../lib/keymanager.php';
-require_once __DIR__ . '/../lib/proxy.php';
-require_once __DIR__ . '/../lib/stream.php';
-require_once __DIR__ . '/../lib/util.php';
-require_once __DIR__ . '/../appinfo/app.php';
-
 use OCA\Encryption;
 
 /**
index cc0cff9aa5ca5f142189975db915794b14d301b5..c838ddd29d1d90665e250824a8ba14b3cc930aa4 100755 (executable)
  *
  */
 
-require_once __DIR__ . '/../../../lib/base.php';
-require_once __DIR__ . '/../lib/crypt.php';
-require_once __DIR__ . '/../lib/keymanager.php';
-require_once __DIR__ . '/../lib/proxy.php';
-require_once __DIR__ . '/../lib/stream.php';
-require_once __DIR__ . '/../lib/util.php';
-require_once __DIR__ . '/../appinfo/app.php';
 require_once __DIR__ . '/util.php';
 
 use OCA\Encryption;
index 035aa1b6a5bede5a074482b6b4c2ca26bfbd33e2..88acbd8e775dad99da8e8cd71bf0877c0cfe5521 100644 (file)
  *
  */
 
-require_once __DIR__ . '/base.php';
-
 use OCA\Files\Share;
+use OCA\Files_sharing\Tests\TestCase;
 
 /**
  * Class Test_Files_Sharing_Api
  */
-class Test_Files_Sharing_Api extends Test_Files_Sharing_Base {
+class Test_Files_Sharing_Api extends TestCase {
 
        const TEST_FOLDER_NAME = '/folder_share_api_test';
 
index 9653713a9f99045ce69675ffe97e6821f561f97b..e113c9406782ae77b57a15fec63fe4a6ed2e69b1 100644 (file)
  *
  */
 
-require_once __DIR__ . '/base.php';
-
 use OCA\Files\Share;
+use OCA\Files_sharing\Tests\TestCase;
 
 /**
  * Class Test_Files_Sharing
  */
-class Test_Files_Sharing_Backend extends Test_Files_Sharing_Base {
+class Test_Files_Sharing_Backend extends TestCase {
 
        const TEST_FOLDER_NAME = '/folder_share_api_test';
 
diff --git a/apps/files_sharing/tests/base.php b/apps/files_sharing/tests/base.php
deleted file mode 100644 (file)
index 6bc02ec..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-<?php
-/**
- * ownCloud
- *
- * @author Bjoern Schiessle
- * @copyright 2013 Bjoern Schiessle <schiessle@owncloud.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
- *
- * You should have received a copy of the GNU Affero General Public
- * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-require_once __DIR__ . '/../../../lib/base.php';
-
-use OCA\Files\Share;
-
-/**
- * Class Test_Files_Sharing_Base
- *
- * Base class for sharing tests.
- */
-abstract class Test_Files_Sharing_Base extends \PHPUnit_Framework_TestCase {
-
-       const TEST_FILES_SHARING_API_USER1 = "test-share-user1";
-       const TEST_FILES_SHARING_API_USER2 = "test-share-user2";
-       const TEST_FILES_SHARING_API_USER3 = "test-share-user3";
-
-       const TEST_FILES_SHARING_API_GROUP1 = "test-share-group1";
-
-       public static $stateFilesEncryption;
-       public $filename;
-       public $data;
-       /**
-        * @var OC\Files\View
-        */
-       public $view;
-       public $folder;
-       public $subfolder;
-
-       public static function setUpBeforeClass() {
-
-               // remember files_encryption state
-               self::$stateFilesEncryption = \OC_App::isEnabled('files_encryption');
-
-               //we don't want to tests with app files_encryption enabled
-               \OC_App::disable('files_encryption');
-
-               // reset backend
-               \OC_User::clearBackends();
-               \OC_User::useBackend('database');
-
-               // clear share hooks
-               \OC_Hook::clear('OCP\\Share');
-               \OC::registerShareHooks();
-               \OCP\Util::connectHook('OC_Filesystem', 'setup', '\OC\Files\Storage\Shared', 'setup');
-
-               // create users
-               self::loginHelper(self::TEST_FILES_SHARING_API_USER1, true);
-               self::loginHelper(self::TEST_FILES_SHARING_API_USER2, true);
-               self::loginHelper(self::TEST_FILES_SHARING_API_USER3, true);
-
-               // create group
-               \OC_Group::createGroup(self::TEST_FILES_SHARING_API_GROUP1);
-               \OC_Group::addToGroup(self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_GROUP1);
-
-       }
-
-       function setUp() {
-
-               $this->assertFalse(\OC_App::isEnabled('files_encryption'));
-
-               //login as user1
-               self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
-
-               $this->data = 'foobar';
-               $this->view = new \OC\Files\View('/' . self::TEST_FILES_SHARING_API_USER1 . '/files');
-       }
-
-       function tearDown() {
-               $query = \OCP\DB::prepare('DELETE FROM `*PREFIX*share`');
-               $query->execute();
-       }
-
-       public static function tearDownAfterClass() {
-
-               // cleanup users
-               \OC_User::deleteUser(self::TEST_FILES_SHARING_API_USER1);
-               \OC_User::deleteUser(self::TEST_FILES_SHARING_API_USER2);
-               \OC_User::deleteUser(self::TEST_FILES_SHARING_API_USER3);
-
-               // delete group
-               \OC_Group::deleteGroup(self::TEST_FILES_SHARING_API_GROUP1);
-
-               // reset app files_encryption
-               if (self::$stateFilesEncryption) {
-                       \OC_App::enable('files_encryption');
-               } else {
-                       \OC_App::disable('files_encryption');
-               }
-       }
-
-       /**
-        * @param string $user
-        * @param bool $create
-        * @param bool $password
-        */
-       protected static function loginHelper($user, $create = false, $password = false) {
-
-               if ($password === false) {
-                       $password = $user;
-               }
-
-               if ($create) {
-                       \OC_User::createUser($user, $password);
-                       \OC_Group::createGroup('group');
-                       \OC_Group::addToGroup($user, 'group');
-               }
-
-               \OC_Util::tearDownFS();
-               \OC::$server->getUserSession()->setUser(null);
-               \OC\Files\Filesystem::tearDown();
-               \OC::$server->getUserSession()->login($user, $password);
-               \OC_Util::setupFS($user);
-       }
-
-       /**
-        * get some information from a given share
-        * @param int $shareID
-        * @return array with: item_source, share_type, share_with, item_type, permissions
-        */
-       protected function getShareFromId($shareID) {
-               $sql = 'SELECT `item_source`, `share_type`, `share_with`, `item_type`, `permissions` FROM `*PREFIX*share` WHERE `id` = ?';
-               $args = array($shareID);
-               $query = \OCP\DB::prepare($sql);
-               $result = $query->execute($args);
-
-               $share = Null;
-
-               if ($result) {
-                       $share = $result->fetchRow();
-               }
-
-               return $share;
-
-       }
-
-}
index 1b0fe6fdc6d3c45ae8eee344ee11aa90761c51f2..2c9790ce66deed2cba9e2fa035d05c5a9f7c01c2 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+use OCA\Files_sharing\Tests\TestCase;
+
 /**
  * ownCloud
  *
@@ -20,9 +22,8 @@
  * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
-require_once __DIR__ . '/base.php';
 
-class Test_Files_Sharing_Cache extends Test_Files_Sharing_Base {
+class Test_Files_Sharing_Cache extends TestCase {
 
        /**
         * @var OC\Files\View
index 2e93afa1987437a189485f4ae5bc4b35790dfe1a..0c741bb8199c85c630aab5544a895c01cdcebd00 100644 (file)
@@ -20,8 +20,6 @@
  *
  */
 
-require_once __DIR__ . '/base.php';
-
 /**
  * Tests for the external Storage class for remote shares.
  */
index 6169a9f50942d04cef3433e9b5fc1cc388945776..1a27739ec34e3f7eb4659f8e8a5db1c2c4c62518 100644 (file)
@@ -1,4 +1,6 @@
 <?php
+use OCA\Files_sharing\Tests\TestCase;
+
 /**
  * ownCloud
  *
@@ -19,9 +21,8 @@
  * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
-require_once __DIR__ . '/base.php';
 
-class Test_Files_Sharing_Helper extends Test_Files_Sharing_Base {
+class Test_Files_Sharing_Helper extends TestCase {
 
        /**
         * test set and get share folder
index 299e471a3fd3ca6fd86eaabfb3e80a7ffa4c2525..639ebfb593667ab49bfdf31059def2a6e840746f 100644 (file)
@@ -23,9 +23,8 @@ use OC\Files\Cache\Cache;
 use OC\Files\Storage\Storage;
 use OC\Files\View;
 
-require_once __DIR__ . '/base.php';
 
-class Test_Files_Sharing_Permissions extends Test_Files_Sharing_Base {
+class Test_Files_Sharing_Permissions extends OCA\Files_sharing\Tests\TestCase {
 
        /**
         * @var Storage
index b6599a1b6466b8f6e585d778ce0054bd465e7559..68cd81f963a7b179f3b679eabc4dff7928140575 100644 (file)
  *
  */
 
-require_once __DIR__ . '/base.php';
 
 use OCA\Files\Share;
 
 /**
  * Class Test_Files_Sharing_Proxy
  */
-class Test_Files_Sharing_Proxy extends Test_Files_Sharing_Base {
+class Test_Files_Sharing_Proxy extends OCA\Files_sharing\Tests\TestCase {
 
        const TEST_FOLDER_NAME = '/folder_share_api_test';
 
index fe80cfca781db28a32a6665614342e4b8c5ae409..2b5978f8e5752f846c4c758c166f7045303ddd0a 100644 (file)
  *
  */
 
-require_once __DIR__ . '/base.php';
-
 use OCA\Files\Share;
 
 /**
  * Class Test_Files_Sharing
  */
-class Test_Files_Sharing extends Test_Files_Sharing_Base {
+class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase {
 
        const TEST_FOLDER_NAME = '/folder_share_api_test';
 
index ac910944f9f6511cccf7a051c25a315a4e55c5f9..e991d381e140aab7b06635c4bfa20608fb5d62b5 100644 (file)
  *
  */
 
-require_once __DIR__ . '/base.php';
-
 /**
  * Class Test_Files_Sharing_Api
  */
-class Test_Files_Sharing_Mount extends Test_Files_Sharing_Base {
+class Test_Files_Sharing_Mount extends OCA\Files_sharing\Tests\TestCase {
 
        function setUp() {
                parent::setUp();
index 972f9257e2597a937acd357b45eeb1a5da8e699e..b106add13000e52824f8d05ae9796ebfbbc931ae 100644 (file)
  *
  */
 
-require_once __DIR__ . '/base.php';
-
 use OCA\Files\Share;
 
 /**
  * Class Test_Files_Sharing_Api
  */
-class Test_Files_Sharing_Storage extends Test_Files_Sharing_Base {
+class Test_Files_Sharing_Storage extends OCA\Files_sharing\Tests\TestCase {
 
        function setUp() {
                parent::setUp();
diff --git a/apps/files_sharing/tests/testcase.php b/apps/files_sharing/tests/testcase.php
new file mode 100644 (file)
index 0000000..a098feb
--- /dev/null
@@ -0,0 +1,157 @@
+<?php
+/**
+ * ownCloud
+ *
+ * @author Bjoern Schiessle
+ * @copyright 2013 Bjoern Schiessle <schiessle@owncloud.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\Files_Sharing\Tests;
+
+use OCA\Files\Share;
+
+/**
+ * Class Test_Files_Sharing_Base
+ *
+ * Base class for sharing tests.
+ */
+abstract class TestCase extends \PHPUnit_Framework_TestCase {
+
+       const TEST_FILES_SHARING_API_USER1 = "test-share-user1";
+       const TEST_FILES_SHARING_API_USER2 = "test-share-user2";
+       const TEST_FILES_SHARING_API_USER3 = "test-share-user3";
+
+       const TEST_FILES_SHARING_API_GROUP1 = "test-share-group1";
+
+       public static $stateFilesEncryption;
+       public $filename;
+       public $data;
+       /**
+        * @var \OC\Files\View
+        */
+       public $view;
+       public $folder;
+       public $subfolder;
+
+       public static function setUpBeforeClass() {
+
+               // remember files_encryption state
+               self::$stateFilesEncryption = \OC_App::isEnabled('files_encryption');
+
+               //we don't want to tests with app files_encryption enabled
+               \OC_App::disable('files_encryption');
+
+               // reset backend
+               \OC_User::clearBackends();
+               \OC_User::useBackend('database');
+
+               // clear share hooks
+               \OC_Hook::clear('OCP\\Share');
+               \OC::registerShareHooks();
+               \OCP\Util::connectHook('OC_Filesystem', 'setup', '\OC\Files\Storage\Shared', 'setup');
+
+               // create users
+               self::loginHelper(self::TEST_FILES_SHARING_API_USER1, true);
+               self::loginHelper(self::TEST_FILES_SHARING_API_USER2, true);
+               self::loginHelper(self::TEST_FILES_SHARING_API_USER3, true);
+
+               // create group
+               \OC_Group::createGroup(self::TEST_FILES_SHARING_API_GROUP1);
+               \OC_Group::addToGroup(self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_GROUP1);
+
+       }
+
+       function setUp() {
+
+               $this->assertFalse(\OC_App::isEnabled('files_encryption'));
+
+               //login as user1
+               self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
+
+               $this->data = 'foobar';
+               $this->view = new \OC\Files\View('/' . self::TEST_FILES_SHARING_API_USER1 . '/files');
+       }
+
+       function tearDown() {
+               $query = \OCP\DB::prepare('DELETE FROM `*PREFIX*share`');
+               $query->execute();
+       }
+
+       public static function tearDownAfterClass() {
+
+               // cleanup users
+               \OC_User::deleteUser(self::TEST_FILES_SHARING_API_USER1);
+               \OC_User::deleteUser(self::TEST_FILES_SHARING_API_USER2);
+               \OC_User::deleteUser(self::TEST_FILES_SHARING_API_USER3);
+
+               // delete group
+               \OC_Group::deleteGroup(self::TEST_FILES_SHARING_API_GROUP1);
+
+               // reset app files_encryption
+               if (self::$stateFilesEncryption) {
+                       \OC_App::enable('files_encryption');
+               } else {
+                       \OC_App::disable('files_encryption');
+               }
+       }
+
+       /**
+        * @param string $user
+        * @param bool $create
+        * @param bool $password
+        */
+       protected static function loginHelper($user, $create = false, $password = false) {
+
+               if ($password === false) {
+                       $password = $user;
+               }
+
+               if ($create) {
+                       \OC_User::createUser($user, $password);
+                       \OC_Group::createGroup('group');
+                       \OC_Group::addToGroup($user, 'group');
+               }
+
+               \OC_Util::tearDownFS();
+               \OC::$server->getUserSession()->setUser(null);
+               \OC\Files\Filesystem::tearDown();
+               \OC::$server->getUserSession()->login($user, $password);
+               \OC_Util::setupFS($user);
+       }
+
+       /**
+        * get some information from a given share
+        * @param int $shareID
+        * @return array with: item_source, share_type, share_with, item_type, permissions
+        */
+       protected function getShareFromId($shareID) {
+               $sql = 'SELECT `item_source`, `share_type`, `share_with`, `item_type`, `permissions` FROM `*PREFIX*share` WHERE `id` = ?';
+               $args = array($shareID);
+               $query = \OCP\DB::prepare($sql);
+               $result = $query->execute($args);
+
+               $share = Null;
+
+               if ($result) {
+                       $share = $result->fetchRow();
+               }
+
+               return $share;
+
+       }
+
+}
index be29c38acc398e7dfd73887bddbcb0c8f361b6d3..583f607d9cb1a294bad6503c9ed5f807de19fd0e 100644 (file)
  */
 
 require_once __DIR__ . '/../appinfo/update.php';
-require_once __DIR__ . '/base.php';
 
 /**
  * Class Test_Files_Sharing_Update
  */
-class Test_Files_Sharing_Update_Routine extends Test_Files_Sharing_Base {
+class Test_Files_Sharing_Update_Routine extends OCA\Files_Sharing\Tests\TestCase {
 
        const TEST_FOLDER_NAME = '/folder_share_api_test';
 
index 1f51b9a315c6a7552794f29959726744a8f1ecf8..07349c1334dbe6ab4d52d425828b255b3e268333 100644 (file)
  */
 
 require_once __DIR__ . '/../appinfo/update.php';
-require_once __DIR__ . '/base.php';
 
 /**
  * Class Test_Files_Sharing_Updater
  */
-class Test_Files_Sharing_Updater extends Test_Files_Sharing_Base {
+class Test_Files_Sharing_Updater extends OCA\Files_sharing\Tests\TestCase {
 
        const TEST_FOLDER_NAME = '/folder_share_updater_test';
 
index bce93c80a6c3076dda38156a99e351102bd84f34..67f55394ae842af432b4dd349aa08f2769c65bb7 100644 (file)
  * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
-require_once __DIR__ . '/base.php';
 
-class Test_Files_Sharing_Watcher extends Test_Files_Sharing_Base {
+class Test_Files_Sharing_Watcher extends OCA\Files_sharing\Tests\TestCase {
+
+       /**
+        * @var \OC\Files\Storage\Storage
+        */
+       private $ownerStorage;
+
+       /**
+        * @var \OC\Files\Cache\Cache
+        */
+       private $ownerCache;
+
+       /**
+        * @var \OC\Files\Storage\Storage
+        */
+       private $sharedStorage;
+
+       /**
+        * @var \OC\Files\Cache\Cache
+        */
+       private $sharedCache;
 
        function setUp() {
                parent::setUp();
index 6a8955f5d1d856a10af335b11bad3ef174dbd36e..6fdb53f72710205dc7fd2336be6aa2d5da6dc4ae 100644 (file)
@@ -20,8 +20,6 @@
  *
  */
 
-require_once __DIR__ . '/../../../lib/base.php';
-
 use OCA\Files_Trashbin;
 
 /**
index 558c8dfcb8abc9c61b82792c13c898310526851b..4909d0606b193b67c63257c349f37a2cbd0784db 100644 (file)
@@ -32,6 +32,9 @@ class Test_Files_Versioning extends \PHPUnit_Framework_TestCase {
        const TEST_VERSIONS_USER = 'test-versions-user';
        const USERS_VERSIONS_ROOT = '/test-versions-user/files_versions';
 
+       /**
+        * @var \OC\Files\View
+        */
        private $rootView;
 
        public static function setUpBeforeClass() {
@@ -63,7 +66,7 @@ class Test_Files_Versioning extends \PHPUnit_Framework_TestCase {
         */
        function testGetExpireList($versions, $sizeOfAllDeletedFiles) {
 
-               // last interval enda at 2592000
+               // last interval end at 2592000
                $startTime = 5000000;
 
                $testClass = new VersionStorageToTest();
index 5be16ce3c497716464e1402896d2b116ca550a1d..ab381e5c29807299149a9b903afa868b22fcda5d 100644 (file)
 namespace OCP\AppFramework\Http;
 
 
-//require_once(__DIR__ . "/../classloader.php");
+class ChildDownloadResponse extends DownloadResponse {
 
-
-class ChildDownloadResponse extends DownloadResponse {};
+};
 
 
 class DownloadResponseTest extends \PHPUnit_Framework_TestCase {
 
+       /**
+        * @var ChildDownloadResponse
+        */
        protected $response;
 
        protected function setUp(){
index c62fa43863abd526fb8f50d96d5829fe83fb4b51..a7a189c98e5e15dc72a52bc510d389c4bfcf21c9 100644 (file)
@@ -26,13 +26,14 @@ namespace OC\AppFramework\Http;
 
 use OC\AppFramework\Http;
 
-//require_once(__DIR__ . "/../classloader.php");
-
-
 
 class HttpTest extends \PHPUnit_Framework_TestCase {
 
        private $server;
+
+       /**
+        * @var Http
+        */
        private $http;
 
        protected function setUp(){
index c0c58ebf7612a002e02c0fcd7268bd72e8b1e376..f7c89a9d2e1b3fb77109d48304d07945c7c6135c 100644 (file)
@@ -30,10 +30,6 @@ namespace OC\AppFramework\Http;
 use OCP\AppFramework\Http\JSONResponse;
 use OCP\AppFramework\Http;
 
-//require_once(__DIR__ . "/../classloader.php");
-
-
-
 class JSONResponseTest extends \PHPUnit_Framework_TestCase {
 
        /**
index dfd0d7ee7dcc9a03e0f7a27b8b196f24144613ab..e5d452f7f916e5d7daa513570f5bcc51668de921 100644 (file)
@@ -26,13 +26,12 @@ namespace OCP\AppFramework\Http;
 
 use OCP\AppFramework\Http;
 
-//require_once(__DIR__ . "/../classloader.php");
-
-
 
 class RedirectResponseTest extends \PHPUnit_Framework_TestCase {
 
-
+       /**
+        * @var RedirectResponse
+        */
        protected $response;
 
        protected function setUp(){
index db98bb4e9c266f3bd8f10204b870e72542522a1c..5b9089b32e14cee8f3581ad08d4731d31e822451 100644 (file)
@@ -6,8 +6,6 @@
  * See the COPYING-README file.
  */
 
-require_once 'archive.php';
-
 class Test_Archive_TAR extends Test_Archive {
        public function setUp() {
                if (OC_Util::runningOnWindows()) {
index 195e3450f3ff76a40129df4c40a01041dacfec0a..90958baf38024a66125aefe8e997766f5cdf7d66 100644 (file)
@@ -6,8 +6,6 @@
  * See the COPYING-README file.
  */
 
-require_once 'archive.php';
-
 if (!OC_Util::runningOnWindows()) {
 class Test_Archive_ZIP extends Test_Archive {
        protected function getExisting() {