diff options
-rw-r--r-- | apps/files_sharing/publicwebdav.php | 1 | ||||
-rw-r--r-- | apps/files_trashbin/lib/trashbin.php | 6 | ||||
-rw-r--r-- | tests/lib/db/connection.php | 19 |
3 files changed, 24 insertions, 2 deletions
diff --git a/apps/files_sharing/publicwebdav.php b/apps/files_sharing/publicwebdav.php index 2c7ccf8d92c..240891ffef6 100644 --- a/apps/files_sharing/publicwebdav.php +++ b/apps/files_sharing/publicwebdav.php @@ -54,7 +54,6 @@ $server->subscribeEvent('beforeMethod', function () use ($server, $objectTree, $ $ownerView = \OC\Files\Filesystem::getView(); $path = $ownerView->getPath($fileId); - $view = new \OC\Files\View($ownerView->getAbsolutePath($path)); $rootInfo = $view->getFileInfo(''); diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php index 952af56bacc..26257bd3817 100644 --- a/apps/files_trashbin/lib/trashbin.php +++ b/apps/files_trashbin/lib/trashbin.php @@ -22,6 +22,8 @@ namespace OCA\Files_Trashbin; +use OC\Files\Filesystem; + class Trashbin { // how long do we keep files in the trash bin if no other value is defined in the config file (unit: days) @@ -136,7 +138,9 @@ class Trashbin { * @param string $file_path path to the deleted file/directory relative to the files root directory */ public static function move2trash($file_path) { - $user = \OCP\User::getUser(); + // get the user for which the filesystem is setup + $root = Filesystem::getRoot(); + list(, $user) = explode('/', $root); $size = 0; list($owner, $ownerPath) = self::getUidAndFilename($file_path); diff --git a/tests/lib/db/connection.php b/tests/lib/db/connection.php index 070c75db55d..720b448d0fb 100644 --- a/tests/lib/db/connection.php +++ b/tests/lib/db/connection.php @@ -18,6 +18,25 @@ class Connection extends \Test\TestCase { */ private $connection; + public static function setUpBeforeClass() + { + self::dropTestTable(); + parent::setUpBeforeClass(); + } + + public static function tearDownAfterClass() + { + self::dropTestTable(); + parent::tearDownAfterClass(); + } + + protected static function dropTestTable() + { + if (\OC::$server->getConfig()->getSystemValue('dbtype', 'sqlite') !== 'oci') { + \OC_DB::dropTable('table'); + } + } + public function setUp() { parent::setUp(); $this->connection = \OC::$server->getDatabaseConnection(); |