From 49dd79eabb2b8902559a7a4e8f8fcad54f46b604 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Sun, 15 Sep 2024 22:32:31 +0200 Subject: refactor: Add void return type to PHPUnit test methods Signed-off-by: Christoph Wurst --- tests/lib/Encryption/ManagerTest.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'tests/lib/Encryption/ManagerTest.php') 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; -- cgit v1.2.3