aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests/UnshareChildrenTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/tests/UnshareChildrenTest.php')
-rw-r--r--apps/files_sharing/tests/UnshareChildrenTest.php46
1 files changed, 15 insertions, 31 deletions
diff --git a/apps/files_sharing/tests/UnshareChildrenTest.php b/apps/files_sharing/tests/UnshareChildrenTest.php
index db6f0912419..ac870212c99 100644
--- a/apps/files_sharing/tests/UnshareChildrenTest.php
+++ b/apps/files_sharing/tests/UnshareChildrenTest.php
@@ -1,32 +1,16 @@
<?php
+
/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Björn Schießle <bjoern@schiessle.org>
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Joas Schilling <coding@schilljs.com>
- * @author Robin Appelman <robin@icewind.nl>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- * @author Thomas Müller <thomas.mueller@tmit.eu>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program 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, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
+ * SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OCA\Files_Sharing\Tests;
+use OC\Files\Filesystem;
+use OCP\Constants;
use OCP\Share\IShare;
+use OCP\Util;
/**
* Class UnshareChildrenTest
@@ -45,7 +29,7 @@ class UnshareChildrenTest extends TestCase {
protected function setUp(): void {
parent::setUp();
- \OCP\Util::connectHook('OC_Filesystem', 'post_delete', '\OCA\Files_Sharing\Hooks', 'unshareChildren');
+ Util::connectHook('OC_Filesystem', 'post_delete', '\OCA\Files_Sharing\Hooks', 'unshareChildren');
$this->folder = self::TEST_FOLDER_NAME;
$this->subfolder = '/subfolder_share_api_test';
@@ -74,15 +58,15 @@ class UnshareChildrenTest extends TestCase {
/**
* @medium
*/
- public function testUnshareChildren() {
- $fileInfo2 = \OC\Files\Filesystem::getFileInfo($this->folder);
+ public function testUnshareChildren(): void {
+ $fileInfo2 = Filesystem::getFileInfo($this->folder);
$this->share(
IShare::TYPE_USER,
$this->folder,
self::TEST_FILES_SHARING_API_USER1,
self::TEST_FILES_SHARING_API_USER2,
- \OCP\Constants::PERMISSION_ALL
+ Constants::PERMISSION_ALL
);
self::loginHelper(self::TEST_FILES_SHARING_API_USER2);
@@ -92,11 +76,11 @@ class UnshareChildrenTest extends TestCase {
$this->assertCount(1, $shares);
// move shared folder to 'localDir'
- \OC\Files\Filesystem::mkdir('localDir');
- $result = \OC\Files\Filesystem::rename($this->folder, '/localDir/' . $this->folder);
+ Filesystem::mkdir('localDir');
+ $result = Filesystem::rename($this->folder, '/localDir/' . $this->folder);
$this->assertTrue($result);
- \OC\Files\Filesystem::unlink('localDir');
+ Filesystem::unlink('localDir');
self::loginHelper(self::TEST_FILES_SHARING_API_USER2);
@@ -107,6 +91,6 @@ class UnshareChildrenTest extends TestCase {
self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
// the folder for the owner should still exists
- $this->assertTrue(\OC\Files\Filesystem::file_exists($this->folder));
+ $this->assertTrue(Filesystem::file_exists($this->folder));
}
}