diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2024-09-15 22:32:31 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2024-09-15 22:32:31 +0200 |
commit | 49dd79eabb2b8902559a7a4e8f8fcad54f46b604 (patch) | |
tree | 2af18db46ba463368dc4461d7436fb69577923de /tests/lib/Encryption/ManagerTest.php | |
parent | 4281ce6fa1bb8235426099d720734d2394bec203 (diff) | |
download | nextcloud-server-49dd79eabb2b8902559a7a4e8f8fcad54f46b604.tar.gz nextcloud-server-49dd79eabb2b8902559a7a4e8f8fcad54f46b604.zip |
refactor: Add void return type to PHPUnit test methods
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests/lib/Encryption/ManagerTest.php')
-rw-r--r-- | tests/lib/Encryption/ManagerTest.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/lib/Encryption/ManagerTest.php b/tests/lib/Encryption/ManagerTest.php index d092068f6c6..8dd602349b6 100644 --- a/tests/lib/Encryption/ManagerTest.php +++ b/tests/lib/Encryption/ManagerTest.php @@ -49,16 +49,16 @@ class ManagerTest extends TestCase { $this->manager = new Manager($this->config, $this->logger, $this->l10n, $this->view, $this->util, $this->arrayCache); } - public function testManagerIsDisabled() { + public function testManagerIsDisabled(): void { $this->assertFalse($this->manager->isEnabled()); } - public function testManagerIsDisabledIfEnabledButNoModules() { + public function testManagerIsDisabledIfEnabledButNoModules(): void { $this->config->expects($this->any())->method('getAppValue')->willReturn(true); $this->assertFalse($this->manager->isEnabled()); } - public function testManagerIsDisabledIfDisabledButModules() { + public function testManagerIsDisabledIfDisabledButModules(): void { $this->config->expects($this->any())->method('getAppValue')->willReturn(false); $em = $this->createMock(IEncryptionModule::class); $em->expects($this->any())->method('getId')->willReturn('id'); @@ -69,7 +69,7 @@ class ManagerTest extends TestCase { $this->assertFalse($this->manager->isEnabled()); } - public function testManagerIsEnabled() { + public function testManagerIsEnabled(): void { $this->config->expects($this->any())->method('getSystemValueBool')->willReturn(true); $this->config->expects($this->any())->method('getAppValue')->willReturn('yes'); $this->assertTrue($this->manager->isEnabled()); @@ -87,14 +87,14 @@ class ManagerTest extends TestCase { /** * @depends testModuleRegistration */ - public function testModuleReRegistration($manager) { + public function testModuleReRegistration($manager): void { $this->expectException(\OC\Encryption\Exceptions\ModuleAlreadyExistsException::class); $this->expectExceptionMessage('Id "ID0" already used by encryption module "TestDummyModule0"'); $this->addNewEncryptionModule($manager, 0); } - public function testModuleUnRegistration() { + public function testModuleUnRegistration(): void { $this->config->expects($this->any())->method('getAppValue')->willReturn(true); $this->addNewEncryptionModule($this->manager, 0); $this->assertCount(1, $this->manager->getEncryptionModules()); @@ -104,7 +104,7 @@ class ManagerTest extends TestCase { } - public function testGetEncryptionModuleUnknown() { + public function testGetEncryptionModuleUnknown(): void { $this->expectException(\OC\Encryption\Exceptions\ModuleDoesNotExistsException::class); $this->expectExceptionMessage('Module with ID: unknown does not exist.'); @@ -114,7 +114,7 @@ class ManagerTest extends TestCase { $this->manager->getEncryptionModule('unknown'); } - public function testGetEncryptionModuleEmpty() { + public function testGetEncryptionModuleEmpty(): void { global $defaultId; $defaultId = null; @@ -138,7 +138,7 @@ class ManagerTest extends TestCase { $this->assertEquals('ID1', $this->manager->getEncryptionModule()->getId()); } - public function testGetEncryptionModule() { + public function testGetEncryptionModule(): void { global $defaultId; $defaultId = null; @@ -163,7 +163,7 @@ class ManagerTest extends TestCase { $this->assertEquals('ID0', $this->manager->getDefaultEncryptionModuleId()); } - public function testSetDefaultEncryptionModule() { + public function testSetDefaultEncryptionModule(): void { global $defaultId; $defaultId = null; |