aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests/SizePropagationTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/tests/SizePropagationTest.php')
-rw-r--r--apps/files_sharing/tests/SizePropagationTest.php39
1 files changed, 12 insertions, 27 deletions
diff --git a/apps/files_sharing/tests/SizePropagationTest.php b/apps/files_sharing/tests/SizePropagationTest.php
index ddb77459073..e1b67abca90 100644
--- a/apps/files_sharing/tests/SizePropagationTest.php
+++ b/apps/files_sharing/tests/SizePropagationTest.php
@@ -1,31 +1,16 @@
<?php
+
/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @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: 2016-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\View;
+use OCP\Constants;
+use OCP\ITempManager;
+use OCP\Server;
use OCP\Share\IShare;
use Test\Traits\UserTrait;
@@ -41,13 +26,13 @@ class SizePropagationTest extends TestCase {
protected function setupUser($name, $password = '') {
$this->createUser($name, $password);
- $tmpFolder = \OC::$server->getTempManager()->getTemporaryFolder();
+ $tmpFolder = Server::get(ITempManager::class)->getTemporaryFolder();
$this->registerMount($name, '\OC\Files\Storage\Local', '/' . $name, ['datadir' => $tmpFolder]);
$this->loginAsUser($name);
return new View('/' . $name . '/files');
}
- public function testSizePropagationWhenOwnerChangesFile() {
+ public function testSizePropagationWhenOwnerChangesFile(): void {
$recipientView = $this->setupUser(self::TEST_FILES_SHARING_API_USER1);
$ownerView = $this->setupUser(self::TEST_FILES_SHARING_API_USER2);
@@ -59,7 +44,7 @@ class SizePropagationTest extends TestCase {
'/sharedfolder',
self::TEST_FILES_SHARING_API_USER2,
self::TEST_FILES_SHARING_API_USER1,
- \OCP\Constants::PERMISSION_ALL
+ Constants::PERMISSION_ALL
);
$ownerRootInfo = $ownerView->getFileInfo('', false);
@@ -82,7 +67,7 @@ class SizePropagationTest extends TestCase {
$this->assertEquals($ownerRootInfo->getSize() + 3, $newOwnerRootInfo->getSize());
}
- public function testSizePropagationWhenRecipientChangesFile() {
+ public function testSizePropagationWhenRecipientChangesFile(): void {
$recipientView = $this->setupUser(self::TEST_FILES_SHARING_API_USER1);
$ownerView = $this->setupUser(self::TEST_FILES_SHARING_API_USER2);
@@ -94,7 +79,7 @@ class SizePropagationTest extends TestCase {
'/sharedfolder',
self::TEST_FILES_SHARING_API_USER2,
self::TEST_FILES_SHARING_API_USER1,
- \OCP\Constants::PERMISSION_ALL
+ Constants::PERMISSION_ALL
);
$ownerRootInfo = $ownerView->getFileInfo('', false);