diff options
Diffstat (limited to 'tests/lib/Files/Mount/ManagerTest.php')
-rw-r--r-- | tests/lib/Files/Mount/ManagerTest.php | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/tests/lib/Files/Mount/ManagerTest.php b/tests/lib/Files/Mount/ManagerTest.php index f69f8b239bb..e6cf3348664 100644 --- a/tests/lib/Files/Mount/ManagerTest.php +++ b/tests/lib/Files/Mount/ManagerTest.php @@ -1,18 +1,19 @@ <?php + /** - * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com> - * This file is licensed under the Affero General Public License version 3 or - * later. - * See the COPYING-README file. + * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-FileCopyrightText: 2016 ownCloud, Inc. + * SPDX-License-Identifier: AGPL-3.0-or-later */ namespace Test\Files\Mount; +use OC\Files\Mount\MountPoint; use OC\Files\SetupManagerFactory; use OC\Files\Storage\Temporary; class LongId extends Temporary { - public function getId() { + public function getId(): string { return 'long:' . str_repeat('foo', 50) . parent::getId(); } } @@ -28,34 +29,34 @@ class ManagerTest extends \Test\TestCase { $this->manager = new \OC\Files\Mount\Manager($this->createMock(SetupManagerFactory::class)); } - public function testFind() { - $rootMount = new \OC\Files\Mount\MountPoint(new Temporary([]), '/'); + public function testFind(): void { + $rootMount = new MountPoint(new Temporary([]), '/'); $this->manager->addMount($rootMount); $this->assertEquals($rootMount, $this->manager->find('/')); $this->assertEquals($rootMount, $this->manager->find('/foo/bar')); $storage = new Temporary([]); - $mount1 = new \OC\Files\Mount\MountPoint($storage, '/foo'); + $mount1 = new MountPoint($storage, '/foo'); $this->manager->addMount($mount1); $this->assertEquals($rootMount, $this->manager->find('/')); $this->assertEquals($mount1, $this->manager->find('/foo/bar')); $this->assertEquals(1, count($this->manager->findIn('/'))); - $mount2 = new \OC\Files\Mount\MountPoint(new Temporary([]), '/bar'); + $mount2 = new MountPoint(new Temporary([]), '/bar'); $this->manager->addMount($mount2); $this->assertEquals(2, count($this->manager->findIn('/'))); $id = $mount1->getStorageId(); $this->assertEquals([$mount1], $this->manager->findByStorageId($id)); - $mount3 = new \OC\Files\Mount\MountPoint($storage, '/foo/bar'); + $mount3 = new MountPoint($storage, '/foo/bar'); $this->manager->addMount($mount3); $this->assertEquals([$mount1, $mount3], $this->manager->findByStorageId($id)); } - public function testLong() { + public function testLong(): void { $storage = new LongId([]); - $mount = new \OC\Files\Mount\MountPoint($storage, '/foo'); + $mount = new MountPoint($storage, '/foo'); $this->manager->addMount($mount); $id = $mount->getStorageId(); |