aboutsummaryrefslogtreecommitdiffstats
path: root/apps/encryption/tests/Users/SetupTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/encryption/tests/Users/SetupTest.php')
-rw-r--r--apps/encryption/tests/Users/SetupTest.php24
1 files changed, 10 insertions, 14 deletions
diff --git a/apps/encryption/tests/Users/SetupTest.php b/apps/encryption/tests/Users/SetupTest.php
index 7a6beaf3594..6b2b8b4cad5 100644
--- a/apps/encryption/tests/Users/SetupTest.php
+++ b/apps/encryption/tests/Users/SetupTest.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@@ -10,21 +12,15 @@ namespace OCA\Encryption\Tests\Users;
use OCA\Encryption\Crypto\Crypt;
use OCA\Encryption\KeyManager;
use OCA\Encryption\Users\Setup;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class SetupTest extends TestCase {
- /**
- * @var KeyManager|\PHPUnit\Framework\MockObject\MockObject
- */
- private $keyManagerMock;
- /**
- * @var Crypt|\PHPUnit\Framework\MockObject\MockObject
- */
- private $cryptMock;
- /**
- * @var Setup
- */
- private $instance;
+
+ protected Setup $instance;
+
+ protected KeyManager&MockObject $keyManagerMock;
+ protected Crypt&MockObject $cryptMock;
protected function setUp(): void {
parent::setUp();
@@ -50,11 +46,11 @@ class SetupTest extends TestCase {
}
/**
- * @dataProvider dataTestSetupUser
*
* @param bool $hasKeys
* @param bool $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataTestSetupUser')]
public function testSetupUser($hasKeys, $expected): void {
$this->keyManagerMock->expects($this->once())->method('userHasKeys')
->with('uid')->willReturn($hasKeys);
@@ -72,7 +68,7 @@ class SetupTest extends TestCase {
);
}
- public function dataTestSetupUser() {
+ public static function dataTestSetupUser(): array {
return [
[true, true],
[false, true]