diff options
Diffstat (limited to 'apps/encryption/tests/Command')
-rw-r--r-- | apps/encryption/tests/Command/FixEncryptedVersionTest.php | 14 | ||||
-rw-r--r-- | apps/encryption/tests/Command/TestEnableMasterKey.php | 6 |
2 files changed, 11 insertions, 9 deletions
diff --git a/apps/encryption/tests/Command/FixEncryptedVersionTest.php b/apps/encryption/tests/Command/FixEncryptedVersionTest.php index 7a69b4bf901..d0af359183b 100644 --- a/apps/encryption/tests/Command/FixEncryptedVersionTest.php +++ b/apps/encryption/tests/Command/FixEncryptedVersionTest.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + /** * SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2019 ownCloud GmbH @@ -16,6 +18,7 @@ use OCP\IConfig; use OCP\ITempManager; use OCP\IUserManager; use OCP\Server; +use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; use Symfony\Component\Console\Tester\CommandTester; use Test\TestCase; @@ -34,16 +37,13 @@ class FixEncryptedVersionTest extends TestCase { use EncryptionTrait; use UserTrait; - private $userId; + private string $userId; - /** @var FixEncryptedVersion */ - private $fixEncryptedVersion; + private FixEncryptedVersion $fixEncryptedVersion; - /** @var CommandTester */ - private $commandTester; + private CommandTester $commandTester; - /** @var Util|\PHPUnit\Framework\MockObject\MockObject */ - protected $util; + protected Util&MockObject $util; public function setUp(): void { parent::setUp(); diff --git a/apps/encryption/tests/Command/TestEnableMasterKey.php b/apps/encryption/tests/Command/TestEnableMasterKey.php index c4678b778bc..ead3dfd0195 100644 --- a/apps/encryption/tests/Command/TestEnableMasterKey.php +++ b/apps/encryption/tests/Command/TestEnableMasterKey.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + /** * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -53,11 +55,11 @@ class TestEnableMasterKey extends TestCase { } /** - * @dataProvider dataTestExecute * * @param bool $isAlreadyEnabled * @param string $answer */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataTestExecute')] public function testExecute($isAlreadyEnabled, $answer): void { $this->util->expects($this->once())->method('isMasterKeyEnabled') ->willReturn($isAlreadyEnabled); @@ -79,7 +81,7 @@ class TestEnableMasterKey extends TestCase { $this->invokePrivate($this->enableMasterKey, 'execute', [$this->input, $this->output]); } - public function dataTestExecute() { + public static function dataTestExecute() { return [ [true, ''], [false, 'y'], |