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 /apps/updatenotification | |
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 'apps/updatenotification')
6 files changed, 21 insertions, 21 deletions
diff --git a/apps/updatenotification/tests/BackgroundJob/ResetTokenTest.php b/apps/updatenotification/tests/BackgroundJob/ResetTokenTest.php index b93efd3a275..1b0fe0cbc59 100644 --- a/apps/updatenotification/tests/BackgroundJob/ResetTokenTest.php +++ b/apps/updatenotification/tests/BackgroundJob/ResetTokenTest.php @@ -33,7 +33,7 @@ class ResetTokenTest extends TestCase { ); } - public function testRunWithNotExpiredToken() { + public function testRunWithNotExpiredToken(): void { $this->timeFactory ->expects($this->atLeastOnce()) ->method('getTime') @@ -54,7 +54,7 @@ class ResetTokenTest extends TestCase { static::invokePrivate($this->resetTokenBackgroundJob, 'run', [null]); } - public function testRunWithExpiredToken() { + public function testRunWithExpiredToken(): void { $this->timeFactory ->expects($this->once()) ->method('getTime') @@ -72,7 +72,7 @@ class ResetTokenTest extends TestCase { static::invokePrivate($this->resetTokenBackgroundJob, 'run', [null]); } - public function testRunWithExpiredTokenAndReadOnlyConfigFile() { + public function testRunWithExpiredTokenAndReadOnlyConfigFile(): void { $this->timeFactory ->expects($this->never()) ->method('getTime'); diff --git a/apps/updatenotification/tests/BackgroundJob/UpdateAvailableNotificationsTest.php b/apps/updatenotification/tests/BackgroundJob/UpdateAvailableNotificationsTest.php index ca058cedff7..ca488fd3014 100644 --- a/apps/updatenotification/tests/BackgroundJob/UpdateAvailableNotificationsTest.php +++ b/apps/updatenotification/tests/BackgroundJob/UpdateAvailableNotificationsTest.php @@ -80,7 +80,7 @@ class UpdateAvailableNotificationsTest extends TestCase { } } - public function testRun() { + public function testRun(): void { $job = $this->getJob([ 'checkCoreUpdate', 'checkAppUpdates', @@ -105,7 +105,7 @@ class UpdateAvailableNotificationsTest extends TestCase { self::invokePrivate($job, 'run', [null]); } - public function testRunNoInternet() { + public function testRunNoInternet(): void { $job = $this->getJob([ 'checkCoreUpdate', 'checkAppUpdates', @@ -160,7 +160,7 @@ class UpdateAvailableNotificationsTest extends TestCase { * @param null|string $readableVersion * @param null|int $errorDays */ - public function testCheckCoreUpdate(string $channel, $versionCheck, $version, $readableVersion, $errorDays) { + public function testCheckCoreUpdate(string $channel, $versionCheck, $version, $readableVersion, $errorDays): void { $job = $this->getJob([ 'getChannel', 'createNotifications', @@ -237,7 +237,7 @@ class UpdateAvailableNotificationsTest extends TestCase { * @param array $isUpdateAvailable * @param array $notifications */ - public function testCheckAppUpdates(array $apps, array $isUpdateAvailable, array $notifications) { + public function testCheckAppUpdates(array $apps, array $isUpdateAvailable, array $notifications): void { $job = $this->getJob([ 'isUpdateAvailable', 'createNotifications', @@ -277,7 +277,7 @@ class UpdateAvailableNotificationsTest extends TestCase { * @param string[]|null $users * @param array|null $userNotifications */ - public function testCreateNotifications(string $app, string $version, $lastNotification, $callDelete, $createNotification, $users, $userNotifications) { + public function testCreateNotifications(string $app, string $version, $lastNotification, $callDelete, $createNotification, $users, $userNotifications): void { $job = $this->getJob([ 'deleteOutdatedNotifications', 'getUsersToNotify', @@ -364,7 +364,7 @@ class UpdateAvailableNotificationsTest extends TestCase { * @param array $groupUsers * @param string[] $expected */ - public function testGetUsersToNotify(array $groups, array $groupUsers, array $expected) { + public function testGetUsersToNotify(array $groups, array $groupUsers, array $expected): void { $job = $this->getJob(); $this->appConfig->expects($this->once()) @@ -408,7 +408,7 @@ class UpdateAvailableNotificationsTest extends TestCase { * @param string $app * @param string $version */ - public function testDeleteOutdatedNotifications(string $app, string $version) { + public function testDeleteOutdatedNotifications(string $app, string $version): void { $notification = $this->createMock(INotification::class); $notification->expects($this->once()) ->method('setApp') diff --git a/apps/updatenotification/tests/Controller/AdminControllerTest.php b/apps/updatenotification/tests/Controller/AdminControllerTest.php index 74fcb4f8773..877a0276373 100644 --- a/apps/updatenotification/tests/Controller/AdminControllerTest.php +++ b/apps/updatenotification/tests/Controller/AdminControllerTest.php @@ -55,7 +55,7 @@ class AdminControllerTest extends TestCase { ); } - public function testCreateCredentials() { + public function testCreateCredentials(): void { $this->jobList ->expects($this->once()) ->method('add') diff --git a/apps/updatenotification/tests/Notification/NotifierTest.php b/apps/updatenotification/tests/Notification/NotifierTest.php index 7455966975a..1e53b8d4aea 100644 --- a/apps/updatenotification/tests/Notification/NotifierTest.php +++ b/apps/updatenotification/tests/Notification/NotifierTest.php @@ -90,7 +90,7 @@ class NotifierTest extends TestCase { * @param string $versionInstalled * @param bool $exception */ - public function testUpdateAlreadyInstalledCheck(string $versionNotification, string $versionInstalled, bool $exception) { + public function testUpdateAlreadyInstalledCheck(string $versionNotification, string $versionInstalled, bool $exception): void { $notifier = $this->getNotifier(); $notification = $this->createMock(INotification::class); diff --git a/apps/updatenotification/tests/Settings/AdminTest.php b/apps/updatenotification/tests/Settings/AdminTest.php index 80ad2ec7587..b39cb8fe127 100644 --- a/apps/updatenotification/tests/Settings/AdminTest.php +++ b/apps/updatenotification/tests/Settings/AdminTest.php @@ -80,7 +80,7 @@ class AdminTest extends TestCase { ); } - public function testGetFormWithUpdate() { + public function testGetFormWithUpdate(): void { $backend1 = $this->createMock(CountUsersBackend::class); $backend2 = $this->createMock(CountUsersBackend::class); $backend3 = $this->createMock(CountUsersBackend::class); @@ -206,7 +206,7 @@ class AdminTest extends TestCase { $this->assertEquals($expected, $this->admin->getForm()); } - public function testGetFormWithUpdateAndChangedUpdateServer() { + public function testGetFormWithUpdateAndChangedUpdateServer(): void { $backend1 = $this->createMock(CountUsersBackend::class); $backend2 = $this->createMock(CountUsersBackend::class); $backend3 = $this->createMock(CountUsersBackend::class); @@ -333,7 +333,7 @@ class AdminTest extends TestCase { $this->assertEquals($expected, $this->admin->getForm()); } - public function testGetFormWithUpdateAndCustomersUpdateServer() { + public function testGetFormWithUpdateAndCustomersUpdateServer(): void { $backend1 = $this->createMock(CountUsersBackend::class); $backend2 = $this->createMock(CountUsersBackend::class); $backend3 = $this->createMock(CountUsersBackend::class); @@ -461,11 +461,11 @@ class AdminTest extends TestCase { } - public function testGetSection() { + public function testGetSection(): void { $this->assertSame('overview', $this->admin->getSection()); } - public function testGetPriority() { + public function testGetPriority(): void { $this->assertSame(11, $this->admin->getPriority()); } @@ -527,7 +527,7 @@ class AdminTest extends TestCase { /** * @dataProvider changesProvider */ - public function testFilterChanges($changes, $userLang, $expectation) { + public function testFilterChanges($changes, $userLang, $expectation): void { $iterator = $this->createMock(ILanguageIterator::class); $iterator->expects($this->any()) ->method('current') diff --git a/apps/updatenotification/tests/UpdateCheckerTest.php b/apps/updatenotification/tests/UpdateCheckerTest.php index 54d756ddcb7..0497a992669 100644 --- a/apps/updatenotification/tests/UpdateCheckerTest.php +++ b/apps/updatenotification/tests/UpdateCheckerTest.php @@ -29,7 +29,7 @@ class UpdateCheckerTest extends TestCase { $this->updateChecker = new UpdateChecker($this->updater, $this->changesChecker); } - public function testGetUpdateStateWithUpdateAndInvalidLink() { + public function testGetUpdateStateWithUpdateAndInvalidLink(): void { $this->updater ->expects($this->once()) ->method('check') @@ -53,7 +53,7 @@ class UpdateCheckerTest extends TestCase { $this->assertSame($expected, $this->updateChecker->getUpdateState()); } - public function testGetUpdateStateWithUpdateAndValidLink() { + public function testGetUpdateStateWithUpdateAndValidLink(): void { $changes = [ 'changelog' => 'https://nextcloud.com/changelog/#123-0-0', 'whatsNew' => [ @@ -101,7 +101,7 @@ class UpdateCheckerTest extends TestCase { $this->assertSame($expected, $this->updateChecker->getUpdateState()); } - public function testGetUpdateStateWithoutUpdate() { + public function testGetUpdateStateWithoutUpdate(): void { $this->updater ->expects($this->once()) ->method('check') |