aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/tests/Backend/BackendTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/tests/Backend/BackendTest.php')
-rw-r--r--apps/files_external/tests/Backend/BackendTest.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/files_external/tests/Backend/BackendTest.php b/apps/files_external/tests/Backend/BackendTest.php
index 771c053982c..1653c354e16 100644
--- a/apps/files_external/tests/Backend/BackendTest.php
+++ b/apps/files_external/tests/Backend/BackendTest.php
@@ -1,4 +1,6 @@
<?php
+
+declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@@ -10,9 +12,9 @@ use OCA\Files_External\Lib\Backend\Backend;
use OCA\Files_External\Lib\StorageConfig;
class BackendTest extends \Test\TestCase {
- public function testJsonSerialization() {
+ public function testJsonSerialization(): void {
$backend = $this->getMockBuilder(Backend::class)
- ->setMethods(['jsonSerializeDefinition'])
+ ->onlyMethods(['jsonSerializeDefinition'])
->getMock();
$backend->expects($this->once())
->method('jsonSerializeDefinition')
@@ -32,19 +34,17 @@ class BackendTest extends \Test\TestCase {
$this->assertContains('barauth', array_keys($json['authSchemes']));
}
- public function validateStorageProvider() {
+ public static function validateStorageProvider(): array {
return [
[true, true],
[false, false],
];
}
- /**
- * @dataProvider validateStorageProvider
- */
- public function testValidateStorage($expectedSuccess, $definitionSuccess) {
+ #[\PHPUnit\Framework\Attributes\DataProvider('validateStorageProvider')]
+ public function testValidateStorage(bool $expectedSuccess, bool $definitionSuccess): void {
$backend = $this->getMockBuilder(Backend::class)
- ->setMethods(['validateStorageDefinition'])
+ ->onlyMethods(['validateStorageDefinition'])
->getMock();
$backend->expects($this->atMost(1))
->method('validateStorageDefinition')
@@ -57,7 +57,7 @@ class BackendTest extends \Test\TestCase {
$this->assertEquals($expectedSuccess, $backend->validateStorage($storageConfig));
}
- public function testLegacyAuthMechanismCallback() {
+ public function testLegacyAuthMechanismCallback(): void {
$backend = new Backend();
$backend->setLegacyAuthMechanismCallback(function (array $params) {
if (isset($params['ping'])) {