diff options
Diffstat (limited to 'apps/encryption/tests/SessionTest.php')
-rw-r--r-- | apps/encryption/tests/SessionTest.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/encryption/tests/SessionTest.php b/apps/encryption/tests/SessionTest.php index 3072bc6ef3b..9e38f857e73 100644 --- a/apps/encryption/tests/SessionTest.php +++ b/apps/encryption/tests/SessionTest.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,17 +12,14 @@ namespace OCA\Encryption\Tests; use OCA\Encryption\Exceptions\PrivateKeyMissingException; use OCA\Encryption\Session; use OCP\ISession; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class SessionTest extends TestCase { private static $tempStorage = []; - /** - * @var Session - */ - private $instance; - /** @var ISession|\PHPUnit\Framework\MockObject\MockObject */ - private $sessionMock; + protected Session $instance; + protected ISession&MockObject $sessionMock; public function testThatGetPrivateKeyThrowsExceptionWhenNotSet(): void { $this->expectException(PrivateKeyMissingException::class); @@ -122,10 +121,11 @@ class SessionTest extends TestCase { * @param bool $expected */ public function testIsReady($status, $expected): void { - /** @var Session | \PHPUnit\Framework\MockObject\MockObject $instance */ + /** @var Session&MockObject $instance */ $instance = $this->getMockBuilder(Session::class) ->setConstructorArgs([$this->sessionMock]) - ->setMethods(['getStatus'])->getMock(); + ->onlyMethods(['getStatus']) + ->getMock(); $instance->expects($this->once())->method('getStatus') ->willReturn($status); @@ -133,7 +133,7 @@ class SessionTest extends TestCase { $this->assertSame($expected, $instance->isReady()); } - public function dataTestIsReady() { + public static function dataTestIsReady(): array { return [ [Session::INIT_SUCCESSFUL, true], [Session::INIT_EXECUTED, false], |