aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/tests/Auth/Password
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/tests/Auth/Password')
-rw-r--r--apps/files_external/tests/Auth/Password/GlobalAuthTest.php (renamed from apps/files_external/tests/Auth/Password/GlobalAuth.php)35
1 files changed, 14 insertions, 21 deletions
diff --git a/apps/files_external/tests/Auth/Password/GlobalAuth.php b/apps/files_external/tests/Auth/Password/GlobalAuthTest.php
index 85a2c1fb27c..6d83655403e 100644
--- a/apps/files_external/tests/Auth/Password/GlobalAuth.php
+++ b/apps/files_external/tests/Auth/Password/GlobalAuthTest.php
@@ -1,4 +1,6 @@
<?php
+
+declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@@ -7,26 +9,17 @@
namespace OCA\Files_External\Tests\Auth\Password;
use OCA\Files_External\Lib\Auth\Password\GlobalAuth;
-use OCA\Files_external\Lib\StorageConfig;
+use OCA\Files_External\Lib\InsufficientDataForMeaningfulAnswerException;
+use OCA\Files_External\Lib\StorageConfig;
use OCP\IL10N;
use OCP\Security\ICredentialsManager;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class GlobalAuthTest extends TestCase {
- /**
- * @var \OCP\IL10N|\PHPUnit\Framework\MockObject\MockObject
- */
- private $l10n;
-
- /**
- * @var \OCP\Security\ICredentialsManager|\PHPUnit\Framework\MockObject\MockObject
- */
- private $credentialsManager;
-
- /**
- * @var GlobalAuth
- */
- private $instance;
+ private IL10N&MockObject $l10n;
+ private ICredentialsManager&MockObject $credentialsManager;
+ private GlobalAuth $instance;
protected function setUp(): void {
parent::setUp();
@@ -36,7 +29,7 @@ class GlobalAuthTest extends TestCase {
}
private function getStorageConfig($type, $config = []) {
- /** @var \OCA\Files_External\Lib\StorageConfig|\PHPUnit\Framework\MockObject\MockObject $storageConfig */
+ /** @var StorageConfig&MockObject $storageConfig */
$storageConfig = $this->createMock(StorageConfig::class);
$storageConfig->expects($this->any())
->method('getType')
@@ -53,14 +46,14 @@ class GlobalAuthTest extends TestCase {
});
$storageConfig->expects($this->any())
->method('setBackendOption')
- ->willReturnCallback(function ($key, $value) use (&$config) {
+ ->willReturnCallback(function ($key, $value) use (&$config): void {
$config[$key] = $value;
});
return $storageConfig;
}
- public function testNoCredentials() {
+ public function testNoCredentials(): void {
$this->credentialsManager->expects($this->once())
->method('retrieve')
->willReturn(null);
@@ -71,7 +64,7 @@ class GlobalAuthTest extends TestCase {
$this->assertEquals([], $storage->getBackendOptions());
}
- public function testSavedCredentials() {
+ public function testSavedCredentials(): void {
$this->credentialsManager->expects($this->once())
->method('retrieve')
->willReturn([
@@ -89,8 +82,8 @@ class GlobalAuthTest extends TestCase {
}
- public function testNoCredentialsPersonal() {
- $this->expectException(\OCA\Files_External\Lib\InsufficientDataForMeaningfulAnswerException::class);
+ public function testNoCredentialsPersonal(): void {
+ $this->expectException(InsufficientDataForMeaningfulAnswerException::class);
$this->credentialsManager->expects($this->never())
->method('retrieve');