diff options
Diffstat (limited to 'apps/files_external/tests/Settings/AdminTest.php')
-rw-r--r-- | apps/files_external/tests/Settings/AdminTest.php | 51 |
1 files changed, 15 insertions, 36 deletions
diff --git a/apps/files_external/tests/Settings/AdminTest.php b/apps/files_external/tests/Settings/AdminTest.php index bad5da8516d..fd4a1949760 100644 --- a/apps/files_external/tests/Settings/AdminTest.php +++ b/apps/files_external/tests/Settings/AdminTest.php @@ -1,49 +1,28 @@ <?php + +declare(strict_types=1); /** - * @copyright Copyright (c) 2016 Lukas Reschke <lukas@statuscode.ch> - * - * @author Christoph Wurst <christoph@winzerhof-wurst.at> - * @author Lukas Reschke <lukas@statuscode.ch> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * 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 - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * + * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ namespace OCA\Files_External\Tests\Settings; use OCA\Files_External\Lib\Auth\Password\GlobalAuth; +use OCA\Files_External\MountConfig; use OCA\Files_External\Service\BackendService; use OCA\Files_External\Service\GlobalStoragesService; use OCA\Files_External\Settings\Admin; use OCP\AppFramework\Http\TemplateResponse; use OCP\Encryption\IManager; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class AdminTest extends TestCase { - /** @var Admin */ - private $admin; - /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */ - private $encryptionManager; - /** @var GlobalStoragesService|\PHPUnit\Framework\MockObject\MockObject */ - private $globalStoragesService; - /** @var BackendService|\PHPUnit\Framework\MockObject\MockObject */ - private $backendService; - /** @var GlobalAuth|\PHPUnit\Framework\MockObject\MockObject */ - private $globalAuth; + private IManager&MockObject $encryptionManager; + private GlobalStoragesService&MockObject $globalStoragesService; + private BackendService&MockObject $backendService; + private GlobalAuth&MockObject $globalAuth; + private Admin $admin; protected function setUp(): void { parent::setUp(); @@ -60,7 +39,7 @@ class AdminTest extends TestCase { ); } - public function testGetForm() { + public function testGetForm(): void { $this->encryptionManager ->expects($this->once()) ->method('isEnabled') @@ -96,7 +75,7 @@ class AdminTest extends TestCase { 'storages' => ['a', 'b', 'c'], 'backends' => ['d', 'e', 'f'], 'authMechanisms' => ['g', 'h', 'i'], - 'dependencies' => \OCA\Files_External\MountConfig::dependencyMessage($this->backendService->getBackends()), + 'dependencies' => MountConfig::dependencyMessage($this->backendService->getBackends()), 'allowUserMounting' => true, 'globalCredentials' => 'asdf:asdf', 'globalCredentialsUid' => '', @@ -105,11 +84,11 @@ class AdminTest extends TestCase { $this->assertEquals($expected, $this->admin->getForm()); } - public function testGetSection() { + public function testGetSection(): void { $this->assertSame('externalstorages', $this->admin->getSection()); } - public function testGetPriority() { + public function testGetPriority(): void { $this->assertSame(40, $this->admin->getPriority()); } } |