aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/comments/tests/Unit/Activity/ListenerTest.php40
-rw-r--r--apps/comments/tests/Unit/AppInfo/ApplicationTest.php19
-rw-r--r--apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php9
-rw-r--r--apps/comments/tests/Unit/Controller/NotificationsTest.php30
-rw-r--r--apps/comments/tests/Unit/EventHandlerTest.php49
-rw-r--r--apps/comments/tests/Unit/Notification/ListenerTest.php82
-rw-r--r--apps/comments/tests/Unit/Notification/NotifierTest.php37
-rw-r--r--apps/contactsinteraction/tests/Db/RecentContactMapperTest.php8
-rw-r--r--apps/dashboard/tests/DashboardServiceTest.php8
-rw-r--r--apps/files/l10n/de.js3
-rw-r--r--apps/files/l10n/de.json3
-rw-r--r--apps/files/l10n/de_DE.js3
-rw-r--r--apps/files/l10n/de_DE.json3
-rw-r--r--apps/files/l10n/et_EE.js3
-rw-r--r--apps/files/l10n/et_EE.json3
-rw-r--r--apps/files/l10n/it.js3
-rw-r--r--apps/files/l10n/it.json3
-rw-r--r--apps/files/l10n/pt_BR.js3
-rw-r--r--apps/files/l10n/pt_BR.json3
-rw-r--r--apps/files/l10n/zh_TW.js3
-rw-r--r--apps/files/l10n/zh_TW.json3
-rw-r--r--apps/files/src/components/FileEntry.vue20
-rw-r--r--apps/files_external/tests/Storage/FtpTest.php2
-rw-r--r--apps/files_external/tests/Storage/SmbTest.php2
-rw-r--r--apps/files_sharing/l10n/ko.js2
-rw-r--r--apps/files_sharing/l10n/ko.json2
-rw-r--r--apps/files_sharing/src/files_filters/AccountFilter.ts6
-rw-r--r--apps/settings/l10n/et_EE.js1
-rw-r--r--apps/settings/l10n/et_EE.json1
-rw-r--r--apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php12
-rw-r--r--apps/twofactor_backupcodes/tests/Service/BackupCodeStorageTest.php13
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php21
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/BackgroundJob/CheckBackupCodeTest.php24
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/BackgroundJob/RememberBackupCodesJobTest.php25
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Controller/SettingsControllerTest.php27
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Listener/ActivityPublisherTest.php11
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Listener/ClearNotificationsTest.php9
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Listener/ProviderDisabledTest.php5
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Listener/ProviderEnabledTest.php5
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Listener/RegistryUpdaterTest.php13
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Migration/CheckBackupCodeTest.php9
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Notification/NotifierTest.php19
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php21
-rw-r--r--apps/updatenotification/tests/BackgroundJob/ResetTokenTest.php6
-rw-r--r--apps/updatenotification/tests/BackgroundJob/UpdateAvailableNotificationsTest.php54
-rw-r--r--apps/updatenotification/tests/Controller/AdminControllerTest.php14
-rw-r--r--apps/updatenotification/tests/Notification/NotifierTest.php10
-rw-r--r--apps/updatenotification/tests/Settings/AdminTest.php6
-rw-r--r--apps/user_ldap/l10n/da.js14
-rw-r--r--apps/user_ldap/l10n/da.json14
-rw-r--r--apps/user_status/tests/Unit/BackgroundJob/ClearOldStatusesBackgroundJobTest.php13
-rw-r--r--apps/user_status/tests/Unit/CapabilitiesTest.php13
-rw-r--r--apps/user_status/tests/Unit/Connector/UserStatusProviderTest.php9
-rw-r--r--apps/user_status/tests/Unit/Controller/PredefinedStatusControllerTest.php12
-rw-r--r--apps/user_status/tests/Unit/Controller/StatusesControllerTest.php9
-rw-r--r--apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php68
-rw-r--r--apps/user_status/tests/Unit/Dashboard/UserStatusWidgetTest.php33
-rw-r--r--apps/user_status/tests/Unit/Db/UserStatusMapperTest.php16
-rw-r--r--apps/user_status/tests/Unit/Listener/UserDeletedListenerTest.php9
-rw-r--r--apps/user_status/tests/Unit/Listener/UserLiveStatusListenerTest.php37
-rw-r--r--apps/user_status/tests/Unit/Service/PredefinedStatusServiceTest.php33
-rw-r--r--apps/user_status/tests/Unit/Service/StatusServiceTest.php86
-rw-r--r--apps/webhook_listeners/tests/Db/WebhookListenerMapperTest.php2
-rw-r--r--apps/workflowengine/tests/Check/AbstractStringCheckTest.php38
-rw-r--r--apps/workflowengine/tests/Check/RequestRemoteAddressTest.php43
-rw-r--r--apps/workflowengine/tests/Check/RequestTimeTest.php46
-rw-r--r--apps/workflowengine/tests/Check/RequestUserAgentTest.php26
67 files changed, 441 insertions, 738 deletions
diff --git a/apps/comments/tests/Unit/Activity/ListenerTest.php b/apps/comments/tests/Unit/Activity/ListenerTest.php
index 70dec741978..675a28a16b1 100644
--- a/apps/comments/tests/Unit/Activity/ListenerTest.php
+++ b/apps/comments/tests/Unit/Activity/ListenerTest.php
@@ -1,4 +1,7 @@
<?php
+
+declare(strict_types=1);
+
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -20,30 +23,17 @@ use OCP\Files\Node;
use OCP\IUser;
use OCP\IUserSession;
use OCP\Share\IShareHelper;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class ListenerTest extends TestCase {
-
- /** @var Listener */
- protected $listener;
-
- /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */
- protected $activityManager;
-
- /** @var IUserSession|\PHPUnit\Framework\MockObject\MockObject */
- protected $session;
-
- /** @var IAppManager|\PHPUnit\Framework\MockObject\MockObject */
- protected $appManager;
-
- /** @var IMountProviderCollection|\PHPUnit\Framework\MockObject\MockObject */
- protected $mountProviderCollection;
-
- /** @var IRootFolder|\PHPUnit\Framework\MockObject\MockObject */
- protected $rootFolder;
-
- /** @var IShareHelper|\PHPUnit\Framework\MockObject\MockObject */
- protected $shareHelper;
+ protected IManager&MockObject $activityManager;
+ protected IUserSession&MockObject $session;
+ protected IAppManager&MockObject $appManager;
+ protected IMountProviderCollection&MockObject $mountProviderCollection;
+ protected IRootFolder&MockObject $rootFolder;
+ protected IShareHelper&MockObject $shareHelper;
+ protected Listener $listener;
protected function setUp(): void {
parent::setUp();
@@ -76,7 +66,7 @@ class ListenerTest extends TestCase {
->method('getObjectType')
->willReturn('files');
- /** @var CommentsEvent|\PHPUnit\Framework\MockObject\MockObject $event */
+ /** @var CommentsEvent|MockObject $event */
$event = $this->createMock(CommentsEvent::class);
$event->expects($this->any())
->method('getComment')
@@ -85,13 +75,13 @@ class ListenerTest extends TestCase {
->method('getEvent')
->willReturn(CommentsEvent::EVENT_ADD);
- /** @var IUser|\PHPUnit\Framework\MockObject\MockObject $ownerUser */
+ /** @var IUser|MockObject $ownerUser */
$ownerUser = $this->createMock(IUser::class);
$ownerUser->expects($this->any())
->method('getUID')
->willReturn('937393');
- /** @var \PHPUnit\Framework\MockObject\MockObject $mount */
+ /** @var MockObject $mount */
$mount = $this->createMock(ICachedMountFileInfo::class);
$mount->expects($this->any())
->method('getUser')
@@ -133,7 +123,7 @@ class ListenerTest extends TestCase {
->method('getUser')
->willReturn($ownerUser);
- /** @var \PHPUnit\Framework\MockObject\MockObject $activity */
+ /** @var MockObject $activity */
$activity = $this->createMock(IEvent::class);
$activity->expects($this->exactly(count($al['users'])))
->method('setAffectedUser');
diff --git a/apps/comments/tests/Unit/AppInfo/ApplicationTest.php b/apps/comments/tests/Unit/AppInfo/ApplicationTest.php
index abd5b188d44..119db5333b5 100644
--- a/apps/comments/tests/Unit/AppInfo/ApplicationTest.php
+++ b/apps/comments/tests/Unit/AppInfo/ApplicationTest.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@@ -7,7 +9,12 @@
*/
namespace OCA\Comments\Tests\Unit\AppInfo;
+use OCA\Comments\Activity\Filter;
+use OCA\Comments\Activity\Listener;
+use OCA\Comments\Activity\Provider;
+use OCA\Comments\Activity\Setting;
use OCA\Comments\AppInfo\Application;
+use OCA\Comments\Controller\NotificationsController;
use OCA\Comments\Notification\Notifier;
use OCP\IUserManager;
use OCP\IUserSession;
@@ -38,12 +45,12 @@ class ApplicationTest extends TestCase {
$c = $app->getContainer();
$services = [
- 'OCA\Comments\Controller\NotificationsController',
- 'OCA\Comments\Activity\Filter',
- 'OCA\Comments\Activity\Listener',
- 'OCA\Comments\Activity\Provider',
- 'OCA\Comments\Activity\Setting',
- 'OCA\Comments\Notification\Listener',
+ NotificationsController::class,
+ Filter::class,
+ Listener::class,
+ Provider::class,
+ Setting::class,
+ \OCA\Comments\Notification\Listener::class,
Notifier::class,
];
diff --git a/apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php b/apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php
index c0de0016c31..525bf5e67c8 100644
--- a/apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php
+++ b/apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php
@@ -8,13 +8,12 @@ namespace OCA\Comments\Tests\Unit\Collaboration;
use OCA\Comments\Collaboration\CommentersSorter;
use OCP\Comments\IComment;
use OCP\Comments\ICommentsManager;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class CommentersSorterTest extends TestCase {
- /** @var ICommentsManager|\PHPUnit\Framework\MockObject\MockObject */
- protected $commentsManager;
- /** @var CommentersSorter */
- protected $sorter;
+ protected ICommentsManager&MockObject $commentsManager;
+ protected CommentersSorter $sorter;
protected function setUp(): void {
parent::setUp();
@@ -55,7 +54,7 @@ class CommentersSorterTest extends TestCase {
$this->assertEquals($data['expected'], $workArray);
}
- public function sortDataProvider() {
+ public static function sortDataProvider(): array {
return [[
[
#1 – sort properly and otherwise keep existing order
diff --git a/apps/comments/tests/Unit/Controller/NotificationsTest.php b/apps/comments/tests/Unit/Controller/NotificationsTest.php
index ccd808895c8..59d0b9ccb00 100644
--- a/apps/comments/tests/Unit/Controller/NotificationsTest.php
+++ b/apps/comments/tests/Unit/Controller/NotificationsTest.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@@ -22,26 +24,16 @@ use OCP\IUser;
use OCP\IUserSession;
use OCP\Notification\IManager;
use OCP\Notification\INotification;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class NotificationsTest extends TestCase {
- /** @var NotificationsController */
- protected $notificationsController;
-
- /** @var ICommentsManager|\PHPUnit\Framework\MockObject\MockObject */
- protected $commentsManager;
-
- /** @var IRootFolder|\PHPUnit\Framework\MockObject\MockObject */
- protected $rootFolder;
-
- /** @var IUserSession|\PHPUnit\Framework\MockObject\MockObject */
- protected $session;
-
- /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */
- protected $notificationManager;
-
- /** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */
- protected $urlGenerator;
+ protected ICommentsManager&MockObject $commentsManager;
+ protected IRootFolder&MockObject $rootFolder;
+ protected IUserSession&MockObject $session;
+ protected IManager&MockObject $notificationManager;
+ protected IURLGenerator&MockObject $urlGenerator;
+ protected NotificationsController $notificationsController;
protected function setUp(): void {
parent::setUp();
@@ -81,10 +73,6 @@ class NotificationsTest extends TestCase {
$this->urlGenerator->expects($this->exactly(2))
->method('linkToRoute')
- ->withConsecutive(
- ['comments.Notifications.view', ['id' => '42']],
- ['core.login.showLoginForm', ['redirect_url' => 'link-to-comment']]
- )
->willReturnMap([
['comments.Notifications.view', ['id' => '42'], 'link-to-comment'],
['core.login.showLoginForm', ['redirect_url' => 'link-to-comment'], 'link-to-login'],
diff --git a/apps/comments/tests/Unit/EventHandlerTest.php b/apps/comments/tests/Unit/EventHandlerTest.php
index 83ce1af57da..df2876e20a3 100644
--- a/apps/comments/tests/Unit/EventHandlerTest.php
+++ b/apps/comments/tests/Unit/EventHandlerTest.php
@@ -1,4 +1,7 @@
<?php
+
+declare(strict_types=1);
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -10,43 +13,32 @@ use OCA\Comments\Listener\CommentsEventListener;
use OCA\Comments\Notification\Listener as NotificationListener;
use OCP\Comments\CommentsEvent;
use OCP\Comments\IComment;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class EventHandlerTest extends TestCase {
- /** @var CommentsEventListener */
- protected $eventHandler;
-
- /** @var ActivityListener|\PHPUnit\Framework\MockObject\MockObject */
- protected $activityListener;
-
- /** @var NotificationListener|\PHPUnit\Framework\MockObject\MockObject */
- protected $notificationListener;
+ protected ActivityListener&MockObject $activityListener;
+ protected NotificationListener&MockObject $notificationListener;
+ protected CommentsEventListener $eventHandler;
protected function setUp(): void {
parent::setUp();
- $this->activityListener = $this->getMockBuilder(ActivityListener::class)
- ->disableOriginalConstructor()
- ->getMock();
-
- $this->notificationListener = $this->getMockBuilder(NotificationListener::class)
- ->disableOriginalConstructor()
- ->getMock();
+ $this->activityListener = $this->createMock(ActivityListener::class);
+ $this->notificationListener = $this->createMock(NotificationListener::class);
$this->eventHandler = new CommentsEventListener($this->activityListener, $this->notificationListener);
}
public function testNotFiles(): void {
- /** @var IComment|\PHPUnit\Framework\MockObject\MockObject $comment */
- $comment = $this->getMockBuilder(IComment::class)->getMock();
+ /** @var IComment|MockObject $comment */
+ $comment = $this->createMock(IComment::class);
$comment->expects($this->once())
->method('getObjectType')
->willReturn('smiles');
- /** @var CommentsEvent|\PHPUnit\Framework\MockObject\MockObject $event */
- $event = $this->getMockBuilder(CommentsEvent::class)
- ->disableOriginalConstructor()
- ->getMock();
+ /** @var CommentsEvent|MockObject $event */
+ $event = $this->createMock(CommentsEvent::class);
$event->expects($this->once())
->method('getComment')
->willReturn($comment);
@@ -56,7 +48,7 @@ class EventHandlerTest extends TestCase {
$this->eventHandler->handle($event);
}
- public function handledProvider() {
+ public static function handledProvider(): array {
return [
[CommentsEvent::EVENT_DELETE],
[CommentsEvent::EVENT_UPDATE],
@@ -67,19 +59,16 @@ class EventHandlerTest extends TestCase {
/**
* @dataProvider handledProvider
- * @param string $eventType
*/
- public function testHandled($eventType): void {
- /** @var IComment|\PHPUnit\Framework\MockObject\MockObject $comment */
- $comment = $this->getMockBuilder(IComment::class)->getMock();
+ public function testHandled(string $eventType): void {
+ /** @var IComment|MockObject $comment */
+ $comment = $this->createMock(IComment::class);
$comment->expects($this->once())
->method('getObjectType')
->willReturn('files');
- /** @var CommentsEvent|\PHPUnit\Framework\MockObject\MockObject $event */
- $event = $this->getMockBuilder(CommentsEvent::class)
- ->disableOriginalConstructor()
- ->getMock();
+ /** @var CommentsEvent|MockObject $event */
+ $event = $this->createMock(CommentsEvent::class);
$event->expects($this->atLeastOnce())
->method('getComment')
->willReturn($comment);
diff --git a/apps/comments/tests/Unit/Notification/ListenerTest.php b/apps/comments/tests/Unit/Notification/ListenerTest.php
index a9175b7e203..ae5a3c40bc6 100644
--- a/apps/comments/tests/Unit/Notification/ListenerTest.php
+++ b/apps/comments/tests/Unit/Notification/ListenerTest.php
@@ -14,25 +14,19 @@ use OCP\IURLGenerator;
use OCP\IUserManager;
use OCP\Notification\IManager;
use OCP\Notification\INotification;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class ListenerTest extends TestCase {
- /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */
- protected $notificationManager;
-
- /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */
- protected $userManager;
-
- /** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */
- protected $urlGenerator;
-
- /** @var Listener */
- protected $listener;
+ protected IManager&MockObject $notificationManager;
+ protected IUserManager&MockObject $userManager;
+ protected IURLGenerator&MockObject $urlGenerator;
+ protected Listener $listener;
protected function setUp(): void {
parent::setUp();
- $this->notificationManager = $this->createMock(\OCP\Notification\IManager::class);
+ $this->notificationManager = $this->createMock(IManager::class);
$this->userManager = $this->createMock(IUserManager::class);
$this->listener = new Listener(
@@ -41,7 +35,7 @@ class ListenerTest extends TestCase {
);
}
- public function eventProvider() {
+ public static function eventProvider(): array {
return [
[CommentsEvent::EVENT_ADD, 'notify'],
[CommentsEvent::EVENT_UPDATE, 'notify'],
@@ -56,8 +50,8 @@ class ListenerTest extends TestCase {
* @param string $notificationMethod
*/
public function testEvaluate($eventType, $notificationMethod): void {
- /** @var IComment|\PHPUnit\Framework\MockObject\MockObject $comment */
- $comment = $this->getMockBuilder(IComment::class)->getMock();
+ /** @var IComment|MockObject $comment */
+ $comment = $this->createMock(IComment::class);
$comment->expects($this->any())
->method('getObjectType')
->willReturn('files');
@@ -78,10 +72,8 @@ class ListenerTest extends TestCase {
->method('getId')
->willReturn('1234');
- /** @var CommentsEvent|\PHPUnit\Framework\MockObject\MockObject $event */
- $event = $this->getMockBuilder(CommentsEvent::class)
- ->disableOriginalConstructor()
- ->getMock();
+ /** @var CommentsEvent|MockObject $event */
+ $event = $this->createMock(CommentsEvent::class);
$event->expects($this->once())
->method('getComment')
->willReturn($comment);
@@ -89,8 +81,8 @@ class ListenerTest extends TestCase {
->method(('getEvent'))
->willReturn($eventType);
- /** @var INotification|\PHPUnit\Framework\MockObject\MockObject $notification */
- $notification = $this->getMockBuilder(INotification::class)->getMock();
+ /** @var INotification|MockObject $notification */
+ $notification = $this->createMock(INotification::class);
$notification->expects($this->any())
->method($this->anything())
->willReturn($notification);
@@ -106,26 +98,24 @@ class ListenerTest extends TestCase {
$this->userManager->expects($this->exactly(6))
->method('userExists')
- ->withConsecutive(
- ['foobar'],
- ['barfoo'],
- ['foo@bar.com'],
- ['bar@foo.org@foobar.io'],
- ['23452-4333-54353-2342'],
- ['yolo']
- )
- ->willReturn(true);
+ ->willReturnMap([
+ ['foobar', true],
+ ['barfoo', true],
+ ['foo@bar.com', true],
+ ['bar@foo.org@foobar.io', true],
+ ['23452-4333-54353-2342', true],
+ ['yolo', true]
+ ]);
$this->listener->evaluate($event);
}
/**
* @dataProvider eventProvider
- * @param string $eventType
*/
- public function testEvaluateNoMentions($eventType): void {
- /** @var IComment|\PHPUnit\Framework\MockObject\MockObject $comment */
- $comment = $this->getMockBuilder(IComment::class)->getMock();
+ public function testEvaluateNoMentions(string $eventType): void {
+ /** @var IComment|MockObject $comment */
+ $comment = $this->createMock(IComment::class);
$comment->expects($this->any())
->method('getObjectType')
->willReturn('files');
@@ -136,10 +126,8 @@ class ListenerTest extends TestCase {
->method('getMentions')
->willReturn([]);
- /** @var CommentsEvent|\PHPUnit\Framework\MockObject\MockObject $event */
- $event = $this->getMockBuilder(CommentsEvent::class)
- ->disableOriginalConstructor()
- ->getMock();
+ /** @var CommentsEvent|MockObject $event */
+ $event = $this->createMock(CommentsEvent::class);
$event->expects($this->once())
->method('getComment')
->willReturn($comment);
@@ -161,8 +149,8 @@ class ListenerTest extends TestCase {
}
public function testEvaluateUserDoesNotExist(): void {
- /** @var IComment|\PHPUnit\Framework\MockObject\MockObject $comment */
- $comment = $this->getMockBuilder(IComment::class)->getMock();
+ /** @var IComment|MockObject $comment */
+ $comment = $this->createMock(IComment::class);
$comment->expects($this->any())
->method('getObjectType')
->willReturn('files');
@@ -176,10 +164,8 @@ class ListenerTest extends TestCase {
->method('getId')
->willReturn('1234');
- /** @var CommentsEvent|\PHPUnit\Framework\MockObject\MockObject $event */
- $event = $this->getMockBuilder(CommentsEvent::class)
- ->disableOriginalConstructor()
- ->getMock();
+ /** @var CommentsEvent|MockObject $event */
+ $event = $this->createMock(CommentsEvent::class);
$event->expects($this->once())
->method('getComment')
->willReturn($comment);
@@ -187,8 +173,8 @@ class ListenerTest extends TestCase {
->method(('getEvent'))
->willReturn(CommentsEvent::EVENT_ADD);
- /** @var INotification|\PHPUnit\Framework\MockObject\MockObject $notification */
- $notification = $this->getMockBuilder(INotification::class)->getMock();
+ /** @var INotification|MockObject $notification */
+ $notification = $this->createMock(INotification::class);
$notification->expects($this->any())
->method($this->anything())
->willReturn($notification);
@@ -203,9 +189,7 @@ class ListenerTest extends TestCase {
$this->userManager->expects($this->once())
->method('userExists')
- ->withConsecutive(
- ['foobar']
- )
+ ->with('foobar')
->willReturn(false);
$this->listener->evaluate($event);
diff --git a/apps/comments/tests/Unit/Notification/NotifierTest.php b/apps/comments/tests/Unit/Notification/NotifierTest.php
index 87b87e646af..37cad0b43df 100644
--- a/apps/comments/tests/Unit/Notification/NotifierTest.php
+++ b/apps/comments/tests/Unit/Notification/NotifierTest.php
@@ -1,4 +1,7 @@
<?php
+
+declare(strict_types=1);
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -23,26 +26,16 @@ use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class NotifierTest extends TestCase {
- /** @var Notifier */
- protected $notifier;
- /** @var IFactory|MockObject */
- protected $l10nFactory;
- /** @var IL10N|MockObject */
- protected $l;
- /** @var IRootFolder|MockObject */
- protected $folder;
- /** @var ICommentsManager|MockObject */
- protected $commentsManager;
- /** @var IURLGenerator|MockObject */
- protected $url;
- /** @var IUserManager|MockObject */
- protected $userManager;
- /** @var INotification|MockObject */
- protected $notification;
- /** @var IComment|MockObject */
- protected $comment;
- /** @var string */
- protected $lc = 'tlh_KX';
+ protected IFactory&MockObject $l10nFactory;
+ protected IL10N&MockObject $l;
+ protected IRootFolder&MockObject $folder;
+ protected ICommentsManager&MockObject $commentsManager;
+ protected IURLGenerator&MockObject $url;
+ protected IUserManager&MockObject $userManager;
+ protected INotification&MockObject $notification;
+ protected IComment&MockObject $comment;
+ protected Notifier $notifier;
+ protected string $lc = 'tlh_KX';
protected function setUp(): void {
parent::setUp();
@@ -75,9 +68,8 @@ class NotifierTest extends TestCase {
public function testPrepareSuccess(): void {
$fileName = 'Gre\'thor.odp';
$displayName = 'Huraga';
- $message = '@Huraga mentioned you in a comment on "Gre\'thor.odp"';
- /** @var Node|MockObject $node */
+ /** @var Node&MockObject $node */
$node = $this->createMock(Node::class);
$node
->expects($this->atLeastOnce())
@@ -192,7 +184,6 @@ class NotifierTest extends TestCase {
public function testPrepareSuccessDeletedUser(): void {
$fileName = 'Gre\'thor.odp';
- $message = 'You were mentioned on "Gre\'thor.odp", in a comment by an account that has since been deleted';
/** @var Node|MockObject $node */
$node = $this->createMock(Node::class);
diff --git a/apps/contactsinteraction/tests/Db/RecentContactMapperTest.php b/apps/contactsinteraction/tests/Db/RecentContactMapperTest.php
index 89e192d9da7..f5df27820d7 100644
--- a/apps/contactsinteraction/tests/Db/RecentContactMapperTest.php
+++ b/apps/contactsinteraction/tests/Db/RecentContactMapperTest.php
@@ -21,12 +21,8 @@ use Test\TestCase;
* @group DB
*/
class RecentContactMapperTest extends TestCase {
-
- /** @var RecentContactMapper */
- private $recentContactMapper;
-
- /** @var ITimeFactory */
- private $time;
+ private RecentContactMapper $recentContactMapper;
+ private ITimeFactory $time;
protected function setUp(): void {
parent::setUp();
diff --git a/apps/dashboard/tests/DashboardServiceTest.php b/apps/dashboard/tests/DashboardServiceTest.php
index c603b88e7ff..ebcd06cdf03 100644
--- a/apps/dashboard/tests/DashboardServiceTest.php
+++ b/apps/dashboard/tests/DashboardServiceTest.php
@@ -40,7 +40,7 @@ class DashboardServiceTest extends TestCase {
);
}
- public function testGetBirthdate() {
+ public function testGetBirthdate(): void {
$user = $this->createMock(IUser::class);
$this->userManager->method('get')
->willReturn($user);
@@ -61,7 +61,7 @@ class DashboardServiceTest extends TestCase {
$this->assertEquals('2024-12-10T00:00:00.000Z', $birthdate);
}
- public function testGetBirthdatePropertyDoesNotExist() {
+ public function testGetBirthdatePropertyDoesNotExist(): void {
$user = $this->createMock(IUser::class);
$this->userManager->method('get')
->willReturn($user);
@@ -75,7 +75,7 @@ class DashboardServiceTest extends TestCase {
$this->assertEquals('', $birthdate);
}
- public function testGetBirthdateUserNotFound() {
+ public function testGetBirthdateUserNotFound(): void {
$this->userManager->method('get')
->willReturn(null);
@@ -84,7 +84,7 @@ class DashboardServiceTest extends TestCase {
$this->assertEquals('', $birthdate);
}
- public function testGetBirthdateNoUserId() {
+ public function testGetBirthdateNoUserId(): void {
$service = new DashboardService(
$this->config,
null,
diff --git a/apps/files/l10n/de.js b/apps/files/l10n/de.js
index a4a71d0087f..f4b11b60bfe 100644
--- a/apps/files/l10n/de.js
+++ b/apps/files/l10n/de.js
@@ -98,6 +98,7 @@ OC.L10N.register(
"Renamed \"{oldName}\" to \"{newName}\"" : "\"{oldName}\" in \"{newName}\" umbenannt",
"Rename file" : "Datei umbenennen",
"Folder" : "Ordner",
+ "Unknown file type" : "Unbekannter Dateityp",
"Pending" : "Ausstehend",
"Unknown date" : "Unbekanntes Datum",
"Clear filter" : "Filter zurücksetzen",
@@ -108,6 +109,7 @@ OC.L10N.register(
"Total rows summary" : "Zusammenfassung aller Zeilen",
"Toggle selection for all files and folders" : "Auswahl für alle Dateien und Ordner umschalten",
"Name" : "Name",
+ "File type" : "Dateityp",
"Size" : "Größe",
"\"{displayName}\" failed on some elements" : "\"{displayName}\" ist bei einigen Elementen fehlgeschlagen",
"\"{displayName}\" batch action executed successfully" : "Stapelaktion \"{displayName}\" ausgeführt",
@@ -186,6 +188,7 @@ OC.L10N.register(
"Sort favorites first" : "Favoriten zuerst sortieren",
"Sort folders before files" : "Ordner vor Dateien sortieren",
"Show hidden files" : "Versteckte Dateien anzeigen",
+ "Show file type column" : "Dateityp-Spalte anzeigen",
"Crop image previews" : "Bildvorschauen zuschneiden",
"Enable the grid view" : "Kachelansicht aktivieren",
"Enable folder tree" : "Ordnerstruktur aktivieren",
diff --git a/apps/files/l10n/de.json b/apps/files/l10n/de.json
index 8c460f60c44..f34d8585898 100644
--- a/apps/files/l10n/de.json
+++ b/apps/files/l10n/de.json
@@ -96,6 +96,7 @@
"Renamed \"{oldName}\" to \"{newName}\"" : "\"{oldName}\" in \"{newName}\" umbenannt",
"Rename file" : "Datei umbenennen",
"Folder" : "Ordner",
+ "Unknown file type" : "Unbekannter Dateityp",
"Pending" : "Ausstehend",
"Unknown date" : "Unbekanntes Datum",
"Clear filter" : "Filter zurücksetzen",
@@ -106,6 +107,7 @@
"Total rows summary" : "Zusammenfassung aller Zeilen",
"Toggle selection for all files and folders" : "Auswahl für alle Dateien und Ordner umschalten",
"Name" : "Name",
+ "File type" : "Dateityp",
"Size" : "Größe",
"\"{displayName}\" failed on some elements" : "\"{displayName}\" ist bei einigen Elementen fehlgeschlagen",
"\"{displayName}\" batch action executed successfully" : "Stapelaktion \"{displayName}\" ausgeführt",
@@ -184,6 +186,7 @@
"Sort favorites first" : "Favoriten zuerst sortieren",
"Sort folders before files" : "Ordner vor Dateien sortieren",
"Show hidden files" : "Versteckte Dateien anzeigen",
+ "Show file type column" : "Dateityp-Spalte anzeigen",
"Crop image previews" : "Bildvorschauen zuschneiden",
"Enable the grid view" : "Kachelansicht aktivieren",
"Enable folder tree" : "Ordnerstruktur aktivieren",
diff --git a/apps/files/l10n/de_DE.js b/apps/files/l10n/de_DE.js
index b65015e0f68..cbb4d16f40a 100644
--- a/apps/files/l10n/de_DE.js
+++ b/apps/files/l10n/de_DE.js
@@ -98,6 +98,7 @@ OC.L10N.register(
"Renamed \"{oldName}\" to \"{newName}\"" : "\"{oldName}\" in \"{newName}\" umbenannt",
"Rename file" : "Datei umbenennen",
"Folder" : "Ordner",
+ "Unknown file type" : "Unbekannter Dateityp",
"Pending" : "Ausstehend",
"Unknown date" : "Unbekanntes Datum",
"Clear filter" : "Filter zurücksetzen",
@@ -108,6 +109,7 @@ OC.L10N.register(
"Total rows summary" : "Zusammenfassung aller Zeilen",
"Toggle selection for all files and folders" : "Auswahl für alle Dateien und Ordner umschalten",
"Name" : "Name",
+ "File type" : "Dateityp",
"Size" : "Größe",
"\"{displayName}\" failed on some elements" : "\"{displayName}\" ist bei einigen Elementen fehlgeschlagen",
"\"{displayName}\" batch action executed successfully" : "Stapelaktion \"{displayName}\" ausgeführt",
@@ -186,6 +188,7 @@ OC.L10N.register(
"Sort favorites first" : "Favoriten zuerst sortieren",
"Sort folders before files" : "Ordner vor Dateien sortieren",
"Show hidden files" : "Versteckte Dateien anzeigen",
+ "Show file type column" : "Dateityp-Spalte anzeigen",
"Crop image previews" : "Bildvorschauen zuschneiden",
"Enable the grid view" : "Kachelansicht aktivieren",
"Enable folder tree" : "Ordnerstruktur aktivieren",
diff --git a/apps/files/l10n/de_DE.json b/apps/files/l10n/de_DE.json
index 3818398effb..8e1f611f317 100644
--- a/apps/files/l10n/de_DE.json
+++ b/apps/files/l10n/de_DE.json
@@ -96,6 +96,7 @@
"Renamed \"{oldName}\" to \"{newName}\"" : "\"{oldName}\" in \"{newName}\" umbenannt",
"Rename file" : "Datei umbenennen",
"Folder" : "Ordner",
+ "Unknown file type" : "Unbekannter Dateityp",
"Pending" : "Ausstehend",
"Unknown date" : "Unbekanntes Datum",
"Clear filter" : "Filter zurücksetzen",
@@ -106,6 +107,7 @@
"Total rows summary" : "Zusammenfassung aller Zeilen",
"Toggle selection for all files and folders" : "Auswahl für alle Dateien und Ordner umschalten",
"Name" : "Name",
+ "File type" : "Dateityp",
"Size" : "Größe",
"\"{displayName}\" failed on some elements" : "\"{displayName}\" ist bei einigen Elementen fehlgeschlagen",
"\"{displayName}\" batch action executed successfully" : "Stapelaktion \"{displayName}\" ausgeführt",
@@ -184,6 +186,7 @@
"Sort favorites first" : "Favoriten zuerst sortieren",
"Sort folders before files" : "Ordner vor Dateien sortieren",
"Show hidden files" : "Versteckte Dateien anzeigen",
+ "Show file type column" : "Dateityp-Spalte anzeigen",
"Crop image previews" : "Bildvorschauen zuschneiden",
"Enable the grid view" : "Kachelansicht aktivieren",
"Enable folder tree" : "Ordnerstruktur aktivieren",
diff --git a/apps/files/l10n/et_EE.js b/apps/files/l10n/et_EE.js
index 78db65694c1..17330fbf036 100644
--- a/apps/files/l10n/et_EE.js
+++ b/apps/files/l10n/et_EE.js
@@ -98,6 +98,7 @@ OC.L10N.register(
"Renamed \"{oldName}\" to \"{newName}\"" : "Failinimi on muutunud „{oldName}“ ⇨ „{newName}“",
"Rename file" : "Muuda failinime",
"Folder" : "Kaust",
+ "Unknown file type" : "Tundmatu failitüüp",
"Pending" : "Ootel",
"Unknown date" : "Tundmatu kuupäev",
"Clear filter" : "Tühjenda filter",
@@ -108,6 +109,7 @@ OC.L10N.register(
"Total rows summary" : "Ridade koondkokkuvõte",
"Toggle selection for all files and folders" : "Lülita kõikide failide ja kaustade valik sisse/välja",
"Name" : "Nimi",
+ "File type" : "Failitüüp",
"Size" : "Suurus",
"\"{displayName}\" failed on some elements" : "„{displayName}“ ei toiminud mõne objekti puhul",
"\"{displayName}\" batch action executed successfully" : "Pakktöötlus õnnestus: „{displayName}“",
@@ -186,6 +188,7 @@ OC.L10N.register(
"Sort favorites first" : "Järjesta lemmikud esimesena",
"Sort folders before files" : "Järjesta kaustad enne faile",
"Show hidden files" : "Näita peidetud faile",
+ "Show file type column" : "Näita failitüübi veergu",
"Crop image previews" : "Kadreeri piltide eelvaated",
"Enable the grid view" : "Võta kasutusele ruudustikuvaade",
"Enable folder tree" : "Võta kasutusele kaustapuu",
diff --git a/apps/files/l10n/et_EE.json b/apps/files/l10n/et_EE.json
index 428758f0287..cb2182202e8 100644
--- a/apps/files/l10n/et_EE.json
+++ b/apps/files/l10n/et_EE.json
@@ -96,6 +96,7 @@
"Renamed \"{oldName}\" to \"{newName}\"" : "Failinimi on muutunud „{oldName}“ ⇨ „{newName}“",
"Rename file" : "Muuda failinime",
"Folder" : "Kaust",
+ "Unknown file type" : "Tundmatu failitüüp",
"Pending" : "Ootel",
"Unknown date" : "Tundmatu kuupäev",
"Clear filter" : "Tühjenda filter",
@@ -106,6 +107,7 @@
"Total rows summary" : "Ridade koondkokkuvõte",
"Toggle selection for all files and folders" : "Lülita kõikide failide ja kaustade valik sisse/välja",
"Name" : "Nimi",
+ "File type" : "Failitüüp",
"Size" : "Suurus",
"\"{displayName}\" failed on some elements" : "„{displayName}“ ei toiminud mõne objekti puhul",
"\"{displayName}\" batch action executed successfully" : "Pakktöötlus õnnestus: „{displayName}“",
@@ -184,6 +186,7 @@
"Sort favorites first" : "Järjesta lemmikud esimesena",
"Sort folders before files" : "Järjesta kaustad enne faile",
"Show hidden files" : "Näita peidetud faile",
+ "Show file type column" : "Näita failitüübi veergu",
"Crop image previews" : "Kadreeri piltide eelvaated",
"Enable the grid view" : "Võta kasutusele ruudustikuvaade",
"Enable folder tree" : "Võta kasutusele kaustapuu",
diff --git a/apps/files/l10n/it.js b/apps/files/l10n/it.js
index a98cb8fe96d..03a1cda9804 100644
--- a/apps/files/l10n/it.js
+++ b/apps/files/l10n/it.js
@@ -98,6 +98,7 @@ OC.L10N.register(
"Renamed \"{oldName}\" to \"{newName}\"" : "Rinominato \"{oldName}\" in \"{newName}\"",
"Rename file" : "Rinomina file",
"Folder" : "Cartella",
+ "Unknown file type" : "Tipo di file sconosciuto",
"Pending" : "In corso",
"Unknown date" : "Data sconosciuta",
"Clear filter" : "Pulisci il filtro",
@@ -108,6 +109,7 @@ OC.L10N.register(
"Total rows summary" : "Riepilogo totale delle righe",
"Toggle selection for all files and folders" : "Attiva/disattiva la selezione per tutti i file e le cartelle",
"Name" : "Nome",
+ "File type" : "Tipo di file",
"Size" : "Dimensione",
"\"{displayName}\" failed on some elements" : "\"{displayName}\" non riuscito su alcuni elementi",
"\"{displayName}\" batch action executed successfully" : "L'azione batch \"{displayName}\" è stata eseguita correttamente",
@@ -186,6 +188,7 @@ OC.L10N.register(
"Sort favorites first" : "Ordina prima i preferiti",
"Sort folders before files" : "Ordina cartelle prima dei files",
"Show hidden files" : "Mostra i file nascosti",
+ "Show file type column" : "Mostra colonna tipo di file",
"Crop image previews" : "Ritaglia le anteprime delle immagini",
"Enable the grid view" : "Attiva visuale a griglia",
"Enable folder tree" : "Abilita l'albero delle cartelle",
diff --git a/apps/files/l10n/it.json b/apps/files/l10n/it.json
index f645e6940bc..e83848ed70a 100644
--- a/apps/files/l10n/it.json
+++ b/apps/files/l10n/it.json
@@ -96,6 +96,7 @@
"Renamed \"{oldName}\" to \"{newName}\"" : "Rinominato \"{oldName}\" in \"{newName}\"",
"Rename file" : "Rinomina file",
"Folder" : "Cartella",
+ "Unknown file type" : "Tipo di file sconosciuto",
"Pending" : "In corso",
"Unknown date" : "Data sconosciuta",
"Clear filter" : "Pulisci il filtro",
@@ -106,6 +107,7 @@
"Total rows summary" : "Riepilogo totale delle righe",
"Toggle selection for all files and folders" : "Attiva/disattiva la selezione per tutti i file e le cartelle",
"Name" : "Nome",
+ "File type" : "Tipo di file",
"Size" : "Dimensione",
"\"{displayName}\" failed on some elements" : "\"{displayName}\" non riuscito su alcuni elementi",
"\"{displayName}\" batch action executed successfully" : "L'azione batch \"{displayName}\" è stata eseguita correttamente",
@@ -184,6 +186,7 @@
"Sort favorites first" : "Ordina prima i preferiti",
"Sort folders before files" : "Ordina cartelle prima dei files",
"Show hidden files" : "Mostra i file nascosti",
+ "Show file type column" : "Mostra colonna tipo di file",
"Crop image previews" : "Ritaglia le anteprime delle immagini",
"Enable the grid view" : "Attiva visuale a griglia",
"Enable folder tree" : "Abilita l'albero delle cartelle",
diff --git a/apps/files/l10n/pt_BR.js b/apps/files/l10n/pt_BR.js
index 3308568155b..65358d419aa 100644
--- a/apps/files/l10n/pt_BR.js
+++ b/apps/files/l10n/pt_BR.js
@@ -98,6 +98,7 @@ OC.L10N.register(
"Renamed \"{oldName}\" to \"{newName}\"" : "\"{oldName}\" foi renomeado para \"{newName}\"",
"Rename file" : "Renomear arquivo",
"Folder" : "Pasta",
+ "Unknown file type" : "Tipo de arquivo desconhecido",
"Pending" : "Pendente",
"Unknown date" : "Data desconhecida",
"Clear filter" : "Limpar filtro",
@@ -108,6 +109,7 @@ OC.L10N.register(
"Total rows summary" : "Resumo do total de linhas",
"Toggle selection for all files and folders" : "Alternar seleção para todos os arquivos e pastas",
"Name" : "Nome",
+ "File type" : "Tipo de arquivo",
"Size" : "Tamanho",
"\"{displayName}\" failed on some elements" : "\"{displayName}\" falhou em alguns elementos",
"\"{displayName}\" batch action executed successfully" : "Ação em lote \"{displayName}\" executada com êxito",
@@ -186,6 +188,7 @@ OC.L10N.register(
"Sort favorites first" : "Ordenar favoritos primeiro",
"Sort folders before files" : "Ordenar pastas antes de arquivos",
"Show hidden files" : "Mostrar arquivos ocultos",
+ "Show file type column" : "Mostrar coluna de tipo de arquivo",
"Crop image previews" : "Cortar visualizações de imagem",
"Enable the grid view" : "Ativar a visualização em grade",
"Enable folder tree" : "Ativar árvore de pastas",
diff --git a/apps/files/l10n/pt_BR.json b/apps/files/l10n/pt_BR.json
index ceec9ac85f4..7b39fa76f77 100644
--- a/apps/files/l10n/pt_BR.json
+++ b/apps/files/l10n/pt_BR.json
@@ -96,6 +96,7 @@
"Renamed \"{oldName}\" to \"{newName}\"" : "\"{oldName}\" foi renomeado para \"{newName}\"",
"Rename file" : "Renomear arquivo",
"Folder" : "Pasta",
+ "Unknown file type" : "Tipo de arquivo desconhecido",
"Pending" : "Pendente",
"Unknown date" : "Data desconhecida",
"Clear filter" : "Limpar filtro",
@@ -106,6 +107,7 @@
"Total rows summary" : "Resumo do total de linhas",
"Toggle selection for all files and folders" : "Alternar seleção para todos os arquivos e pastas",
"Name" : "Nome",
+ "File type" : "Tipo de arquivo",
"Size" : "Tamanho",
"\"{displayName}\" failed on some elements" : "\"{displayName}\" falhou em alguns elementos",
"\"{displayName}\" batch action executed successfully" : "Ação em lote \"{displayName}\" executada com êxito",
@@ -184,6 +186,7 @@
"Sort favorites first" : "Ordenar favoritos primeiro",
"Sort folders before files" : "Ordenar pastas antes de arquivos",
"Show hidden files" : "Mostrar arquivos ocultos",
+ "Show file type column" : "Mostrar coluna de tipo de arquivo",
"Crop image previews" : "Cortar visualizações de imagem",
"Enable the grid view" : "Ativar a visualização em grade",
"Enable folder tree" : "Ativar árvore de pastas",
diff --git a/apps/files/l10n/zh_TW.js b/apps/files/l10n/zh_TW.js
index af800f5614f..51c97322725 100644
--- a/apps/files/l10n/zh_TW.js
+++ b/apps/files/l10n/zh_TW.js
@@ -98,6 +98,7 @@ OC.L10N.register(
"Renamed \"{oldName}\" to \"{newName}\"" : "已將「{oldName}」重新命名為「{newName}」",
"Rename file" : "重新命名檔案",
"Folder" : "資料夾",
+ "Unknown file type" : "未知檔案類型",
"Pending" : "待處理",
"Unknown date" : "未知日期",
"Clear filter" : "清除過濾條件",
@@ -108,6 +109,7 @@ OC.L10N.register(
"Total rows summary" : "總列摘要",
"Toggle selection for all files and folders" : "切換所有檔案和資料夾的選取",
"Name" : "名稱",
+ "File type" : "檔案類型",
"Size" : "大小",
"\"{displayName}\" failed on some elements" : "「{displayName}」在某些元素上失敗",
"\"{displayName}\" batch action executed successfully" : "「{displayName}」批次動作執行成功",
@@ -186,6 +188,7 @@ OC.L10N.register(
"Sort favorites first" : "先排序喜愛",
"Sort folders before files" : "將資料夾排序在檔案前",
"Show hidden files" : "顯示隱藏檔",
+ "Show file type column" : "顯示檔案類型欄位",
"Crop image previews" : "圖片裁剪預覽",
"Enable the grid view" : "啟用格狀檢視",
"Enable folder tree" : "啟用資料夾樹",
diff --git a/apps/files/l10n/zh_TW.json b/apps/files/l10n/zh_TW.json
index 3c1c8d347fa..ead55fc3891 100644
--- a/apps/files/l10n/zh_TW.json
+++ b/apps/files/l10n/zh_TW.json
@@ -96,6 +96,7 @@
"Renamed \"{oldName}\" to \"{newName}\"" : "已將「{oldName}」重新命名為「{newName}」",
"Rename file" : "重新命名檔案",
"Folder" : "資料夾",
+ "Unknown file type" : "未知檔案類型",
"Pending" : "待處理",
"Unknown date" : "未知日期",
"Clear filter" : "清除過濾條件",
@@ -106,6 +107,7 @@
"Total rows summary" : "總列摘要",
"Toggle selection for all files and folders" : "切換所有檔案和資料夾的選取",
"Name" : "名稱",
+ "File type" : "檔案類型",
"Size" : "大小",
"\"{displayName}\" failed on some elements" : "「{displayName}」在某些元素上失敗",
"\"{displayName}\" batch action executed successfully" : "「{displayName}」批次動作執行成功",
@@ -184,6 +186,7 @@
"Sort favorites first" : "先排序喜愛",
"Sort folders before files" : "將資料夾排序在檔案前",
"Show hidden files" : "顯示隱藏檔",
+ "Show file type column" : "顯示檔案類型欄位",
"Crop image previews" : "圖片裁剪預覽",
"Enable the grid view" : "啟用格狀檢視",
"Enable folder tree" : "啟用資料夾樹",
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue
index 3e455a2f135..d66c3fa0ed7 100644
--- a/apps/files/src/components/FileEntry.vue
+++ b/apps/files/src/components/FileEntry.vue
@@ -97,6 +97,7 @@
import { FileType, formatFileSize } from '@nextcloud/files'
import { useHotKey } from '@nextcloud/vue/composables/useHotKey'
import { defineComponent } from 'vue'
+import { t } from '@nextcloud/l10n'
import NcDateTime from '@nextcloud/vue/components/NcDateTime'
import { useNavigation } from '../composables/useNavigation.ts'
@@ -208,6 +209,25 @@ export default defineComponent({
return t('files', 'Unknown file type')
}
+ if (window.OC?.MimeTypeList?.names?.[this.source.mime]) {
+ return window.OC.MimeTypeList.names[this.source.mime]
+ }
+
+ const baseType = this.source.mime.split('/')[0]
+ const ext = this.source?.extension?.toUpperCase().replace(/^\./, '') || ''
+ if (baseType === 'image') {
+ return t('files', '{ext} image', { ext })
+ }
+ if (baseType === 'video') {
+ return t('files', '{ext} video', { ext })
+ }
+ if (baseType === 'audio') {
+ return t('files', '{ext} audio', { ext })
+ }
+ if (baseType === 'text') {
+ return t('files', '{ext} text', { ext })
+ }
+
return this.source.mime
},
size() {
diff --git a/apps/files_external/tests/Storage/FtpTest.php b/apps/files_external/tests/Storage/FtpTest.php
index c6a1d8f77ba..81b92e0fae9 100644
--- a/apps/files_external/tests/Storage/FtpTest.php
+++ b/apps/files_external/tests/Storage/FtpTest.php
@@ -45,7 +45,7 @@ class FtpTest extends \Test\Files\Storage\Storage {
/**
* ftp has no proper way to handle spaces at the end of file names
*/
- public function directoryProvider() {
+ public static function directoryProvider(): array {
return array_filter(parent::directoryProvider(), function ($item) {
return substr($item[0], -1) !== ' ';
});
diff --git a/apps/files_external/tests/Storage/SmbTest.php b/apps/files_external/tests/Storage/SmbTest.php
index d5a83905112..51737d05dc6 100644
--- a/apps/files_external/tests/Storage/SmbTest.php
+++ b/apps/files_external/tests/Storage/SmbTest.php
@@ -49,7 +49,7 @@ class SmbTest extends \Test\Files\Storage\Storage {
parent::tearDown();
}
- public function directoryProvider() {
+ public static function directoryProvider(): array {
// doesn't support leading/trailing spaces
return [['folder']];
}
diff --git a/apps/files_sharing/l10n/ko.js b/apps/files_sharing/l10n/ko.js
index 6c6967c59a8..d946d802981 100644
--- a/apps/files_sharing/l10n/ko.js
+++ b/apps/files_sharing/l10n/ko.js
@@ -311,7 +311,7 @@ OC.L10N.register(
"Link shares" : "링크 공유",
"Shares" : "공유",
"Use this method to share files with individuals or teams within your organization. If the recipient already has access to the share but cannot locate it, you can send them the internal share link for easy access." : "이 방법을 사용하여 조직 내 개인 또는 팀과 파일을 공유하세요. 수신자가 이미 공유 폴더에 접근할 수 있지만 위치를 찾을 수 없는 경우, 쉽게 접근할 수 있도록 내부 공유 링크를 보낼 수 있습니다.",
- "Use this method to share files with individuals or organizations outside your organization. Files and folders can be shared via public share links and email addresses. You can also share to other Nextcloud accounts hosted on different instances using their federated cloud ID." : "이 방법을 사용하면 조직 외부의 조직이나 개인과 파일을 공유할 수 있습니다. 파일과 폴더는 공개 공유 링크와 이메일 주소를 통해 공유할 수 있습니다. 또한, 다른 인스턴스에 소속된 다른 Nextcloud 계정과도 연합 클라우드 ID를 사용하여 공유할 수 있습니다.",
+ "Use this method to share files with individuals or organizations outside your organization. Files and folders can be shared via public share links and email addresses. You can also share to other Nextcloud accounts hosted on different instances using their federated cloud ID." : "이 방법을 사용하여 이 조직 외부의 개인이나 조직과 파일을 공유하세요. 파일과 폴더는 공개 공유 링크와 이메일 주소를 통해 공유할 수 있습니다. 다른 인스턴스에 소속된 다른 Nextcloud 계정과도 연합 클라우드 ID를 사용하여 공유할 수 있습니다.",
"Shares that are not part of the internal or external shares. This can be shares from apps or other sources." : "내부 또는 외부 공유에 포함되지 않은 공유입니다. 앱이나 다른 소스에서 공유된 내용이 여기에 해당할 수 있습니다.",
"Share with accounts, teams, federated cloud IDs" : "계정, 팀 및 연합 클라우드 ID와 공유",
"Share with accounts and teams" : "계정 및 팀과 공유",
diff --git a/apps/files_sharing/l10n/ko.json b/apps/files_sharing/l10n/ko.json
index d08e914da29..4d9e598e1b5 100644
--- a/apps/files_sharing/l10n/ko.json
+++ b/apps/files_sharing/l10n/ko.json
@@ -309,7 +309,7 @@
"Link shares" : "링크 공유",
"Shares" : "공유",
"Use this method to share files with individuals or teams within your organization. If the recipient already has access to the share but cannot locate it, you can send them the internal share link for easy access." : "이 방법을 사용하여 조직 내 개인 또는 팀과 파일을 공유하세요. 수신자가 이미 공유 폴더에 접근할 수 있지만 위치를 찾을 수 없는 경우, 쉽게 접근할 수 있도록 내부 공유 링크를 보낼 수 있습니다.",
- "Use this method to share files with individuals or organizations outside your organization. Files and folders can be shared via public share links and email addresses. You can also share to other Nextcloud accounts hosted on different instances using their federated cloud ID." : "이 방법을 사용하면 조직 외부의 조직이나 개인과 파일을 공유할 수 있습니다. 파일과 폴더는 공개 공유 링크와 이메일 주소를 통해 공유할 수 있습니다. 또한, 다른 인스턴스에 소속된 다른 Nextcloud 계정과도 연합 클라우드 ID를 사용하여 공유할 수 있습니다.",
+ "Use this method to share files with individuals or organizations outside your organization. Files and folders can be shared via public share links and email addresses. You can also share to other Nextcloud accounts hosted on different instances using their federated cloud ID." : "이 방법을 사용하여 이 조직 외부의 개인이나 조직과 파일을 공유하세요. 파일과 폴더는 공개 공유 링크와 이메일 주소를 통해 공유할 수 있습니다. 다른 인스턴스에 소속된 다른 Nextcloud 계정과도 연합 클라우드 ID를 사용하여 공유할 수 있습니다.",
"Shares that are not part of the internal or external shares. This can be shares from apps or other sources." : "내부 또는 외부 공유에 포함되지 않은 공유입니다. 앱이나 다른 소스에서 공유된 내용이 여기에 해당할 수 있습니다.",
"Share with accounts, teams, federated cloud IDs" : "계정, 팀 및 연합 클라우드 ID와 공유",
"Share with accounts and teams" : "계정 및 팀과 공유",
diff --git a/apps/files_sharing/src/files_filters/AccountFilter.ts b/apps/files_sharing/src/files_filters/AccountFilter.ts
index 56bcef07200..4f185d9fd9c 100644
--- a/apps/files_sharing/src/files_filters/AccountFilter.ts
+++ b/apps/files_sharing/src/files_filters/AccountFilter.ts
@@ -10,6 +10,7 @@ import { ShareType } from '@nextcloud/sharing'
import Vue from 'vue'
import FileListFilterAccount from '../components/FileListFilterAccount.vue'
+import { isPublicShare } from '@nextcloud/sharing/public'
export interface IAccountData {
uid: string
@@ -152,5 +153,10 @@ class AccountFilter extends FileListFilter {
* Register the file list filter by owner or sharees
*/
export function registerAccountFilter() {
+ if (isPublicShare()) {
+ // We do not show the filter on public pages - it makes no sense
+ return
+ }
+
registerFileListFilter(new AccountFilter())
}
diff --git a/apps/settings/l10n/et_EE.js b/apps/settings/l10n/et_EE.js
index 35fc7a5d4e3..b04802d8704 100644
--- a/apps/settings/l10n/et_EE.js
+++ b/apps/settings/l10n/et_EE.js
@@ -485,6 +485,7 @@ OC.L10N.register(
"Visibility" : "Nähtavus",
"Show language" : "Näita keelt",
"Show last login" : "Näita viimast sisselogimist",
+ "Sorting" : "Järjestus",
"Sorting only applies to the currently loaded groups for performance reasons. Groups will be loaded as you navigate or search through the list." : "Jõudluse mõttes kehtib järjestus vaid hetkel laaditud gruppidele. Uued grupid lisanduvad sedamööda, kuidas sa loendis edasi liigud.",
"Send email" : "Saada kiri",
"Defaults" : "Vaikeväärtused",
diff --git a/apps/settings/l10n/et_EE.json b/apps/settings/l10n/et_EE.json
index a29cfa38243..c820494e24b 100644
--- a/apps/settings/l10n/et_EE.json
+++ b/apps/settings/l10n/et_EE.json
@@ -483,6 +483,7 @@
"Visibility" : "Nähtavus",
"Show language" : "Näita keelt",
"Show last login" : "Näita viimast sisselogimist",
+ "Sorting" : "Järjestus",
"Sorting only applies to the currently loaded groups for performance reasons. Groups will be loaded as you navigate or search through the list." : "Jõudluse mõttes kehtib järjestus vaid hetkel laaditud gruppidele. Uued grupid lisanduvad sedamööda, kuidas sa loendis edasi liigud.",
"Send email" : "Saada kiri",
"Defaults" : "Vaikeväärtused",
diff --git a/apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php b/apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php
index 6b668f53119..19cab51969b 100644
--- a/apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php
+++ b/apps/twofactor_backupcodes/tests/Db/BackupCodeMapperTest.php
@@ -19,15 +19,9 @@ use Test\TestCase;
* @group DB
*/
class BackupCodeMapperTest extends TestCase {
-
- /** @var IDBConnection */
- private $db;
-
- /** @var BackupCodeMapper */
- private $mapper;
-
- /** @var string */
- private $testUID = 'test123456';
+ private IDBConnection $db;
+ private BackupCodeMapper $mapper;
+ private string $testUID = 'test123456';
private function resetDB() {
$qb = $this->db->getQueryBuilder();
diff --git a/apps/twofactor_backupcodes/tests/Service/BackupCodeStorageTest.php b/apps/twofactor_backupcodes/tests/Service/BackupCodeStorageTest.php
index b556828b924..38d3bd55d11 100644
--- a/apps/twofactor_backupcodes/tests/Service/BackupCodeStorageTest.php
+++ b/apps/twofactor_backupcodes/tests/Service/BackupCodeStorageTest.php
@@ -13,21 +13,16 @@ use OCP\IUser;
use OCP\Notification\IManager;
use OCP\Notification\INotification;
use OCP\Server;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
/**
* @group DB
*/
class BackupCodeStorageTest extends TestCase {
-
- /** @var BackupCodeStorage */
- private $storage;
-
- /** @var string */
- private $testUID = 'test123456789';
-
- /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */
- private $notificationManager;
+ private IManager&MockObject $notificationManager;
+ private string $testUID = 'test123456789';
+ private BackupCodeStorage $storage;
protected function setUp(): void {
parent::setUp();
diff --git a/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php b/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php
index e41db8b0a32..a3c6d15902a 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php
@@ -15,21 +15,14 @@ use OCP\Activity\IManager;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\L10N\IFactory;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class ProviderTest extends TestCase {
-
- /** @var IFactory|\PHPUnit\Framework\MockObject\MockObject */
- private $l10n;
-
- /** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */
- private $urlGenerator;
-
- /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */
- private $activityManager;
-
- /** @var Provider */
- private $provider;
+ private IFactory&MockObject $l10n;
+ private IURLGenerator&MockObject $urlGenerator;
+ private IManager&MockObject $activityManager;
+ private Provider $provider;
protected function setUp(): void {
parent::setUp();
@@ -52,7 +45,7 @@ class ProviderTest extends TestCase {
$this->provider->parse($lang, $event);
}
- public function subjectData() {
+ public static function subjectData(): array {
return [
['codes_generated'],
];
@@ -61,7 +54,7 @@ class ProviderTest extends TestCase {
/**
* @dataProvider subjectData
*/
- public function testParse($subject): void {
+ public function testParse(string $subject): void {
$lang = 'ru';
$event = $this->createMock(IEvent::class);
$l = $this->createMock(IL10N::class);
diff --git a/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/CheckBackupCodeTest.php b/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/CheckBackupCodeTest.php
index 5b8281e278e..87bc65e4309 100644
--- a/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/CheckBackupCodeTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/CheckBackupCodeTest.php
@@ -20,24 +20,12 @@ use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class CheckBackupCodeTest extends TestCase {
-
- /** @var IUserManager|MockObject */
- private $userManager;
-
- /** @var IJobList|MockObject */
- private $jobList;
-
- /** @var IRegistry|MockObject */
- private $registry;
-
- /** @var Manager|MockObject */
- private $manager;
-
- /** @var IUser|MockObject */
- private $user;
-
- /** @var CheckBackupCodes */
- private $checkBackupCodes;
+ private IUserManager&MockObject $userManager;
+ private IJobList&MockObject $jobList;
+ private IRegistry&MockObject $registry;
+ private Manager&MockObject $manager;
+ private IUser&MockObject $user;
+ private CheckBackupCodes $checkBackupCodes;
protected function setUp(): void {
parent::setUp();
diff --git a/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/RememberBackupCodesJobTest.php b/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/RememberBackupCodesJobTest.php
index 31b7d514246..16a0e8012f7 100644
--- a/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/RememberBackupCodesJobTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/RememberBackupCodesJobTest.php
@@ -17,27 +17,16 @@ use OCP\IUserManager;
use OCP\Notification\IManager;
use OCP\Notification\INotification;
use OCP\Server;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class RememberBackupCodesJobTest extends TestCase {
-
- /** @var IRegistry|\PHPUnit\Framework\MockObject\MockObject */
- private $registry;
-
- /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */
- private $userManager;
-
- /** @var ITimeFactory|\PHPUnit\Framework\MockObject\MockObject */
- private $time;
-
- /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */
- private $notificationManager;
-
- /** @var IJobList|\PHPUnit\Framework\MockObject\MockObject */
- private $jobList;
-
- /** @var RememberBackupCodesJob */
- private $job;
+ private IRegistry&MockObject $registry;
+ private IUserManager&MockObject $userManager;
+ private ITimeFactory&MockObject $time;
+ private IManager&MockObject $notificationManager;
+ private IJobList&MockObject $jobList;
+ private RememberBackupCodesJob $job;
protected function setUp(): void {
parent::setUp();
diff --git a/apps/twofactor_backupcodes/tests/Unit/Controller/SettingsControllerTest.php b/apps/twofactor_backupcodes/tests/Unit/Controller/SettingsControllerTest.php
index 85b23e88fee..02c42b65148 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Controller/SettingsControllerTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Controller/SettingsControllerTest.php
@@ -14,36 +14,27 @@ use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest;
use OCP\IUser;
use OCP\IUserSession;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class SettingsControllerTest extends TestCase {
-
- /** @var IRequest|\PHPUnit\Framework\MockObject\MockObject */
- private $request;
-
- /** @var BackupCodeStorage|\PHPUnit\Framework\MockObject\MockObject */
- private $storage;
-
- /** @var IUserSession|\PHPUnit\Framework\MockObject\MockObject */
- private $userSession;
-
- /** @var SettingsController */
- private $controller;
+ private IRequest&MockObject $request;
+ private BackupCodeStorage&MockObject $storage;
+ private IUserSession&MockObject $userSession;
+ private SettingsController $controller;
protected function setUp(): void {
parent::setUp();
- $this->request = $this->getMockBuilder(IRequest::class)->getMock();
- $this->storage = $this->getMockBuilder(BackupCodeStorage::class)
- ->disableOriginalConstructor()
- ->getMock();
- $this->userSession = $this->getMockBuilder(IUserSession::class)->getMock();
+ $this->request = $this->createMock(IRequest::class);
+ $this->storage = $this->createMock(BackupCodeStorage::class);
+ $this->userSession = $this->createMock(IUserSession::class);
$this->controller = new SettingsController('twofactor_backupcodes', $this->request, $this->storage, $this->userSession);
}
public function testCreateCodes(): void {
- $user = $this->getMockBuilder(IUser::class)->getMock();
+ $user = $this->createMock(IUser::class);
$codes = ['a', 'b'];
$this->userSession->expects($this->once())
diff --git a/apps/twofactor_backupcodes/tests/Unit/Listener/ActivityPublisherTest.php b/apps/twofactor_backupcodes/tests/Unit/Listener/ActivityPublisherTest.php
index 72ca91ed8eb..bd944dc2396 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Listener/ActivityPublisherTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Listener/ActivityPublisherTest.php
@@ -19,14 +19,9 @@ use Psr\Log\LoggerInterface;
use Test\TestCase;
class ActivityPublisherTest extends TestCase {
- /** @var IManager|MockObject */
- private $activityManager;
-
- /** @var LoggerInterface */
- private $logger;
-
- /** @var ActivityPublisher */
- private $listener;
+ private IManager&MockObject $activityManager;
+ private LoggerInterface&MockObject $logger;
+ private ActivityPublisher $listener;
protected function setUp(): void {
parent::setUp();
diff --git a/apps/twofactor_backupcodes/tests/Unit/Listener/ClearNotificationsTest.php b/apps/twofactor_backupcodes/tests/Unit/Listener/ClearNotificationsTest.php
index bbefbfbece1..fc80344ac57 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Listener/ClearNotificationsTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Listener/ClearNotificationsTest.php
@@ -15,15 +15,12 @@ use OCP\IUser;
use OCP\Notification\IManager;
use OCP\Notification\INotification;
use OCP\Server;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class ClearNotificationsTest extends TestCase {
-
- /** @var IManager|\PHPUnit\Framework\MockObject\MockObject */
- private $notificationManager;
-
- /** @var ClearNotifications */
- private $listener;
+ private IManager&MockObject $notificationManager;
+ private ClearNotifications $listener;
protected function setUp(): void {
parent::setUp();
diff --git a/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderDisabledTest.php b/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderDisabledTest.php
index 7f7b5dc3011..ea4f530cab4 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderDisabledTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderDisabledTest.php
@@ -15,11 +15,12 @@ use OCP\Authentication\TwoFactorAuth\TwoFactorProviderForUserUnregistered;
use OCP\BackgroundJob\IJobList;
use OCP\EventDispatcher\Event;
use OCP\IUser;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class ProviderDisabledTest extends TestCase {
- private IRegistry $registy;
- private IJobList $jobList;
+ private IRegistry&MockObject $registy;
+ private IJobList&MockObject $jobList;
private ProviderDisabled $listener;
protected function setUp(): void {
diff --git a/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderEnabledTest.php b/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderEnabledTest.php
index 145944fccca..50aac6139c0 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderEnabledTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderEnabledTest.php
@@ -15,11 +15,12 @@ use OCP\Authentication\TwoFactorAuth\TwoFactorProviderForUserRegistered;
use OCP\BackgroundJob\IJobList;
use OCP\EventDispatcher\Event;
use OCP\IUser;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class ProviderEnabledTest extends TestCase {
- private IRegistry $registy;
- private IJobList $jobList;
+ private IRegistry&MockObject $registy;
+ private IJobList&MockObject $jobList;
private ProviderEnabled $listener;
protected function setUp(): void {
diff --git a/apps/twofactor_backupcodes/tests/Unit/Listener/RegistryUpdaterTest.php b/apps/twofactor_backupcodes/tests/Unit/Listener/RegistryUpdaterTest.php
index 4f724f888d7..86d890f0d5e 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Listener/RegistryUpdaterTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Listener/RegistryUpdaterTest.php
@@ -14,18 +14,13 @@ use OCA\TwoFactorBackupCodes\Provider\BackupCodesProvider;
use OCP\Authentication\TwoFactorAuth\IRegistry;
use OCP\EventDispatcher\Event;
use OCP\IUser;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class RegistryUpdaterTest extends TestCase {
-
- /** @var IRegistry */
- private $registry;
-
- /** @var BackupCodesProvider */
- private $provider;
-
- /** @var RegistryUpdater */
- private $listener;
+ private IRegistry&MockObject $registry;
+ private BackupCodesProvider&MockObject $provider;
+ private RegistryUpdater $listener;
protected function setUp(): void {
parent::setUp();
diff --git a/apps/twofactor_backupcodes/tests/Unit/Migration/CheckBackupCodeTest.php b/apps/twofactor_backupcodes/tests/Unit/Migration/CheckBackupCodeTest.php
index bb959ff08b3..c68ab185116 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Migration/CheckBackupCodeTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Migration/CheckBackupCodeTest.php
@@ -11,15 +11,12 @@ namespace OCA\TwoFactorBackupCodes\Tests\Unit\Migration;
use OCA\TwoFactorBackupCodes\Migration\CheckBackupCodes;
use OCP\BackgroundJob\IJobList;
use OCP\Migration\IOutput;
+use PHPunit\Framework\MockObject\MockObject;
use Test\TestCase;
class CheckBackupCodeTest extends TestCase {
-
- /** @var IJobList|\PHPunit\Framework\MockObject\MockObject */
- private $jobList;
-
- /** @var CheckBackupCodes */
- private $checkBackupsCodes;
+ private IJobList&MockObject $jobList;
+ private CheckBackupCodes $checkBackupsCodes;
protected function setUp(): void {
parent::setUp();
diff --git a/apps/twofactor_backupcodes/tests/Unit/Notification/NotifierTest.php b/apps/twofactor_backupcodes/tests/Unit/Notification/NotifierTest.php
index cbda9dd868b..b091d57dbd2 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Notification/NotifierTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Notification/NotifierTest.php
@@ -17,15 +17,10 @@ use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class NotifierTest extends TestCase {
- /** @var Notifier */
- protected $notifier;
-
- /** @var IFactory|MockObject */
- protected $factory;
- /** @var IURLGenerator|MockObject */
- protected $url;
- /** @var IL10N|MockObject */
- protected $l;
+ protected IFactory&MockObject $factory;
+ protected IURLGenerator&MockObject $url;
+ protected IL10N&MockObject $l;
+ protected Notifier $notifier;
protected function setUp(): void {
parent::setUp();
@@ -52,7 +47,7 @@ class NotifierTest extends TestCase {
public function testPrepareWrongApp(): void {
$this->expectException(\InvalidArgumentException::class);
- /** @var INotification|\PHPUnit\Framework\MockObject\MockObject $notification */
+ /** @var INotification|MockObject $notification */
$notification = $this->createMock(INotification::class);
$notification->expects($this->once())
->method('getApp')
@@ -67,7 +62,7 @@ class NotifierTest extends TestCase {
public function testPrepareWrongSubject(): void {
$this->expectException(\InvalidArgumentException::class);
- /** @var INotification|\PHPUnit\Framework\MockObject\MockObject $notification */
+ /** @var INotification|MockObject $notification */
$notification = $this->createMock(INotification::class);
$notification->expects($this->once())
->method('getApp')
@@ -80,7 +75,7 @@ class NotifierTest extends TestCase {
}
public function testPrepare(): void {
- /** @var INotification|\PHPUnit\Framework\MockObject\MockObject $notification */
+ /** @var INotification&MockObject $notification */
$notification = $this->createMock(INotification::class);
$notification->expects($this->once())
diff --git a/apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php b/apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php
index 67124a7a928..069e50b71fd 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php
@@ -16,24 +16,15 @@ use OCP\EventDispatcher\IEventDispatcher;
use OCP\IUser;
use OCP\Security\IHasher;
use OCP\Security\ISecureRandom;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class BackupCodeStorageTest extends TestCase {
-
- /** @var BackupCodeMapper|\PHPUnit\Framework\MockObject\MockObject */
- private $mapper;
-
- /** @var ISecureRandom|\PHPUnit\Framework\MockObject\MockObject */
- private $random;
-
- /** @var IHasher|\PHPUnit\Framework\MockObject\MockObject */
- private $hasher;
-
- /** @var IEventDispatcher|\PHPUnit\Framework\MockObject\MockObject */
- private $eventDispatcher;
-
- /** @var BackupCodeStorage */
- private $storage;
+ private BackupCodeMapper&MockObject $mapper;
+ private ISecureRandom&MockObject $random;
+ private IHasher&MockObject $hasher;
+ private IEventDispatcher&MockObject $eventDispatcher;
+ private BackupCodeStorage $storage;
protected function setUp(): void {
parent::setUp();
diff --git a/apps/updatenotification/tests/BackgroundJob/ResetTokenTest.php b/apps/updatenotification/tests/BackgroundJob/ResetTokenTest.php
index 1b0fe0cbc59..c03d4c48827 100644
--- a/apps/updatenotification/tests/BackgroundJob/ResetTokenTest.php
+++ b/apps/updatenotification/tests/BackgroundJob/ResetTokenTest.php
@@ -16,9 +16,9 @@ use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class ResetTokenTest extends TestCase {
- private IConfig|MockObject $config;
- private IAppConfig|MockObject $appConfig;
- private ITimeFactory|MockObject $timeFactory;
+ private IConfig&MockObject $config;
+ private IAppConfig&MockObject $appConfig;
+ private ITimeFactory&MockObject $timeFactory;
private BackgroundJobResetToken $resetTokenBackgroundJob;
protected function setUp(): void {
diff --git a/apps/updatenotification/tests/BackgroundJob/UpdateAvailableNotificationsTest.php b/apps/updatenotification/tests/BackgroundJob/UpdateAvailableNotificationsTest.php
index 36c1d98f2dc..51237cf012e 100644
--- a/apps/updatenotification/tests/BackgroundJob/UpdateAvailableNotificationsTest.php
+++ b/apps/updatenotification/tests/BackgroundJob/UpdateAvailableNotificationsTest.php
@@ -26,14 +26,14 @@ use Test\TestCase;
class UpdateAvailableNotificationsTest extends TestCase {
private ServerVersion&MockObject $serverVersion;
- private IConfig|MockObject $config;
- private IManager|MockObject $notificationManager;
- private IGroupManager|MockObject $groupManager;
- private IAppManager|MockObject $appManager;
- private IAppConfig|MockObject $appConfig;
- private ITimeFactory|MockObject $timeFactory;
- private Installer|MockObject $installer;
- private VersionCheck|MockObject $versionCheck;
+ private IConfig&MockObject $config;
+ private IManager&MockObject $notificationManager;
+ private IGroupManager&MockObject $groupManager;
+ private IAppManager&MockObject $appManager;
+ private IAppConfig&MockObject $appConfig;
+ private ITimeFactory&MockObject $timeFactory;
+ private Installer&MockObject $installer;
+ private VersionCheck&MockObject $versionCheck;
protected function setUp(): void {
parent::setUp();
@@ -50,10 +50,9 @@ class UpdateAvailableNotificationsTest extends TestCase {
}
/**
- * @param array $methods
* @return UpdateAvailableNotifications|MockObject
*/
- protected function getJob(array $methods = []) {
+ protected function getJob(array $methods = []): UpdateAvailableNotifications {
if (empty($methods)) {
return new UpdateAvailableNotifications(
$this->timeFactory,
@@ -125,7 +124,7 @@ class UpdateAvailableNotificationsTest extends TestCase {
self::invokePrivate($job, 'run', [null]);
}
- public function dataCheckCoreUpdate(): array {
+ public static function dataCheckCoreUpdate(): array {
return [
['daily', null, null, null, null],
['git', null, null, null, null],
@@ -155,14 +154,8 @@ class UpdateAvailableNotificationsTest extends TestCase {
/**
* @dataProvider dataCheckCoreUpdate
- *
- * @param string $channel
- * @param mixed $versionCheck
- * @param null|string $version
- * @param null|string $readableVersion
- * @param null|int $errorDays
*/
- public function testCheckCoreUpdate(string $channel, $versionCheck, $version, $readableVersion, $errorDays): void {
+ public function testCheckCoreUpdate(string $channel, mixed $versionCheck, mixed $version, ?string $readableVersion, ?int $errorDays): void {
$job = $this->getJob([
'createNotifications',
'clearErrorNotifications',
@@ -223,7 +216,7 @@ class UpdateAvailableNotificationsTest extends TestCase {
self::invokePrivate($job, 'checkCoreUpdate');
}
- public function dataCheckAppUpdates(): array {
+ public static function dataCheckAppUpdates(): array {
return [
[
['app1', 'app2'],
@@ -240,10 +233,6 @@ class UpdateAvailableNotificationsTest extends TestCase {
/**
* @dataProvider dataCheckAppUpdates
- *
- * @param string[] $apps
- * @param array $isUpdateAvailable
- * @param array $notifications
*/
public function testCheckAppUpdates(array $apps, array $isUpdateAvailable, array $notifications): void {
$job = $this->getJob([
@@ -271,7 +260,7 @@ class UpdateAvailableNotificationsTest extends TestCase {
self::invokePrivate($job, 'checkAppUpdates');
}
- public function dataCreateNotifications(): array {
+ public static function dataCreateNotifications(): array {
return [
['app1', '1.0.0', '1.0.0', false, false, null, null],
['app2', '1.0.1', '1.0.0', '1.0.0', true, ['user1'], [['user1']]],
@@ -281,16 +270,8 @@ class UpdateAvailableNotificationsTest extends TestCase {
/**
* @dataProvider dataCreateNotifications
- *
- * @param string $app
- * @param string $version
- * @param string|false $lastNotification
- * @param string|false $callDelete
- * @param bool $createNotification
- * @param string[]|null $users
- * @param array|null $userNotifications
*/
- public function testCreateNotifications(string $app, string $version, $lastNotification, $callDelete, $createNotification, $users, $userNotifications): void {
+ public function testCreateNotifications(string $app, string $version, string|false $lastNotification, string|false $callDelete, bool $createNotification, ?array $users, ?array $userNotifications): void {
$job = $this->getJob([
'deleteOutdatedNotifications',
'getUsersToNotify',
@@ -363,7 +344,7 @@ class UpdateAvailableNotificationsTest extends TestCase {
self::invokePrivate($job, 'createNotifications', [$app, $version]);
}
- public function dataGetUsersToNotify(): array {
+ public static function dataGetUsersToNotify(): array {
return [
[['g1', 'g2'], ['g1' => null, 'g2' => ['u1', 'u2']], ['u1', 'u2']],
[['g3', 'g4'], ['g3' => ['u1', 'u2'], 'g4' => ['u2', 'u3']], ['u1', 'u2', 'u3']],
@@ -372,9 +353,6 @@ class UpdateAvailableNotificationsTest extends TestCase {
/**
* @dataProvider dataGetUsersToNotify
- * @param string[] $groups
- * @param array $groupUsers
- * @param string[] $expected
*/
public function testGetUsersToNotify(array $groups, array $groupUsers, array $expected): void {
$job = $this->getJob();
@@ -408,7 +386,7 @@ class UpdateAvailableNotificationsTest extends TestCase {
$this->assertEquals($expected, $result);
}
- public function dataDeleteOutdatedNotifications(): array {
+ public static function dataDeleteOutdatedNotifications(): array {
return [
['app1', '1.1.0'],
['app2', '1.2.0'],
diff --git a/apps/updatenotification/tests/Controller/AdminControllerTest.php b/apps/updatenotification/tests/Controller/AdminControllerTest.php
index 877a0276373..2263495fc14 100644
--- a/apps/updatenotification/tests/Controller/AdminControllerTest.php
+++ b/apps/updatenotification/tests/Controller/AdminControllerTest.php
@@ -22,13 +22,13 @@ use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class AdminControllerTest extends TestCase {
- private IRequest|MockObject $request;
- private IJobList|MockObject $jobList;
- private ISecureRandom|MockObject $secureRandom;
- private IConfig|MockObject $config;
- private ITimeFactory|MockObject $timeFactory;
- private IL10N|MockObject $l10n;
- private IAppConfig|MockObject $appConfig;
+ private IRequest&MockObject $request;
+ private IJobList&MockObject $jobList;
+ private ISecureRandom&MockObject $secureRandom;
+ private IConfig&MockObject $config;
+ private ITimeFactory&MockObject $timeFactory;
+ private IL10N&MockObject $l10n;
+ private IAppConfig&MockObject $appConfig;
private AdminController $adminController;
diff --git a/apps/updatenotification/tests/Notification/NotifierTest.php b/apps/updatenotification/tests/Notification/NotifierTest.php
index 4102fdcb773..6d47d0c6b89 100644
--- a/apps/updatenotification/tests/Notification/NotifierTest.php
+++ b/apps/updatenotification/tests/Notification/NotifierTest.php
@@ -49,9 +49,9 @@ class NotifierTest extends TestCase {
/**
* @param array $methods
- * @return Notifier|\PHPUnit\Framework\MockObject\MockObject
+ * @return Notifier|MockObject
*/
- protected function getNotifier(array $methods = []) {
+ protected function getNotifier(array $methods = []): Notifier {
if (empty($methods)) {
return new Notifier(
$this->urlGenerator,
@@ -81,7 +81,7 @@ class NotifierTest extends TestCase {
}
}
- public function dataUpdateAlreadyInstalledCheck(): array {
+ public static function dataUpdateAlreadyInstalledCheck(): array {
return [
['1.1.0', '1.0.0', false],
['1.1.0', '1.1.0', true],
@@ -91,10 +91,6 @@ class NotifierTest extends TestCase {
/**
* @dataProvider dataUpdateAlreadyInstalledCheck
- *
- * @param string $versionNotification
- * @param string $versionInstalled
- * @param bool $exception
*/
public function testUpdateAlreadyInstalledCheck(string $versionNotification, string $versionInstalled, bool $exception): void {
$notifier = $this->getNotifier();
diff --git a/apps/updatenotification/tests/Settings/AdminTest.php b/apps/updatenotification/tests/Settings/AdminTest.php
index d228c29f119..cb815bc8b69 100644
--- a/apps/updatenotification/tests/Settings/AdminTest.php
+++ b/apps/updatenotification/tests/Settings/AdminTest.php
@@ -29,9 +29,6 @@ use Psr\Log\LoggerInterface;
use Test\TestCase;
class AdminTest extends TestCase {
-
- private Admin $admin;
-
private IFactory&MockObject $l10nFactory;
private IConfig&MockObject $config;
private IAppConfig&MockObject $appConfig;
@@ -43,6 +40,7 @@ class AdminTest extends TestCase {
private LoggerInterface&MockObject $logger;
private IInitialState&MockObject $initialState;
private ServerVersion&MockObject $serverVersion;
+ private Admin $admin;
protected function setUp(): void {
parent::setUp();
@@ -395,7 +393,7 @@ class AdminTest extends TestCase {
$this->assertSame(11, $this->admin->getPriority());
}
- public function changesProvider() {
+ public static function changesProvider(): array {
return [
[ #0, all info, en
[
diff --git a/apps/user_ldap/l10n/da.js b/apps/user_ldap/l10n/da.js
index 1982f52351f..0c909bddbf0 100644
--- a/apps/user_ldap/l10n/da.js
+++ b/apps/user_ldap/l10n/da.js
@@ -20,10 +20,10 @@ OC.L10N.register(
"Good password" : "God adgangskode",
"Strong password" : "Stærk adgangskode",
"The Base DN appears to be wrong" : "Base DN synes at være forkert",
- "Testing configuration…" : "Test af konfiguration...",
- "Configuration incorrect" : "Indstilling forkert",
+ "Testing configuration…" : "Tester konfiguration...",
+ "Configuration incorrect" : "Konfiguration forkert",
"Configuration incomplete" : "Konfiguration ufuldstændig",
- "Configuration OK" : "Indstilling OK",
+ "Configuration OK" : "Konfiguration OK",
"Select groups" : "Vælg grupper",
"Select object classes" : "Vælg objektklasser",
"Please check the credentials, they seem to be wrong." : "Tjek venligst legitimationerne.",
@@ -35,7 +35,7 @@ OC.L10N.register(
"More than 1,000 directory entries available." : "Mere end 1.000 mappeindgange til rådighed.",
"_{objectsFound} entry available within the provided Base DN_::_{objectsFound} entries available within the provided Base DN_" : ["{objectsFound} indgang tilgængelig i den givne Base DN","{objectsFound} poster tilgængelige inden for den givne Base DN"],
"An error occurred. Please check the Base DN, as well as connection settings and credentials." : "Der opstod en fejl. Tjek venligst Base DN samt tilslutningsindstillinger og legitimationsoplysninger.",
- "Do you really want to delete the current Server Configuration?" : "Vil du virkelig slette den aktuelle serverindstilling?",
+ "Do you really want to delete the current Server Configuration?" : "Vil du virkelig slette den aktuelle server konfiguration?",
"Confirm Deletion" : "Bekræft sletning",
"Mappings cleared successfully!" : "Mappings ryddet med succes!",
"Error while clearing the mappings." : "Fejl under rydning af tilknytninger.",
@@ -46,7 +46,7 @@ OC.L10N.register(
"Mode switch" : "Tilstandsafbryder",
"Select attributes" : "Vælg attributter",
"User not found. Please check your login attributes and username. Effective filter (to copy-and-paste for command-line validation): <br/>" : "Brugeren ikke fundet. Tjek venligst dine login attributter og brugernavn. Effektiv filter (til copy- and - paste til kommandolinjevalidering): < br / >",
- "User found and settings verified." : "Brugerfundet og indstillinger verificeret.",
+ "User found and settings verified." : "Bruger fundet og indstillinger verificeret.",
"Consider narrowing your search, as it encompassed many users, only the first one of whom will be able to log in." : "Overvej at indsnævre din søgning, som det omfattede mange brugere, kun den første af dem vil være i stand til at logge ind.",
"An unspecified error occurred. Please check log and settings." : "En uspecificeret fejl opstod. Tjek log og indstillinger.",
"The search filter is invalid, probably due to syntax issues like uneven number of opened and closed brackets. Please revise." : "Søgefilteret er ugyldigt, sandsynligvis på grund af syntaksspørgsmål som ulige antal åbne og lukkede parenteser. Vær venlig at revidere.",
@@ -101,7 +101,7 @@ OC.L10N.register(
"When logging in, %s will find the user based on the following attributes:" : "Når du logger ind, vil %s finde brugeren baseret på følgende egenskaber:",
"LDAP/AD Username:" : "LDAP / AD Brugernavn:",
"Allows login against the LDAP/AD username, which is either \"uid\" or \"sAMAccountName\" and will be detected." : "Tillader login mod LDAP / AD brugernavn, som er enten \"uid\" eller \"SAMAccountName\" og vil blive opdaget.",
- "LDAP/AD Email Address:" : "LDAP / AD Email adresse:",
+ "LDAP/AD Email Address:" : "LDAP / AD E-mail adresse:",
"Allows login against an email attribute. \"mail\" and \"mailPrimaryAddress\" allowed." : "Tillader login mod en e- mail- attribut. \"mail\" og \"mailPrimaryAddress\" tilladt.",
"Other Attributes:" : "Andre attributter:",
"Defines the filter to apply, when login is attempted. \"%%uid\" replaces the username in the login action. Example: \"uid=%%uid\"" : "Definerer det filter der skal anvendes, når login er forsøgt. \"%% uid\" erstatter brugernavnet i login-handlingen. Eksempel: \"uid =%% uid\"",
@@ -131,7 +131,7 @@ OC.L10N.register(
"The most common object classes for users are organizationalPerson, person, user, and inetOrgPerson. If you are not sure which object class to select, please consult your directory admin." : "De mest almindelige objektklasser for brugere er organisationalPerson, person, bruger og inetOrgPerson. Hvis du ikke er sikker på hvilken objektklasse du skal vælge, bedes du konsultere din mappe- admin.",
"The filter specifies which LDAP users shall have access to the %s instance." : "Filteret angiver, hvilke LDAP-brugere der skal have adgang til %s instansen.",
"Verify settings and count users" : "Verificér indstillinger og tæller brugere",
- "Saving" : "Gemning",
+ "Saving" : "Gemmer",
"Back" : "Tilbage",
"Continue" : "Fortsæt",
"Please renew your password." : "Venligst forny din adgangskode.",
diff --git a/apps/user_ldap/l10n/da.json b/apps/user_ldap/l10n/da.json
index 22050580fcb..99ad292499e 100644
--- a/apps/user_ldap/l10n/da.json
+++ b/apps/user_ldap/l10n/da.json
@@ -18,10 +18,10 @@
"Good password" : "God adgangskode",
"Strong password" : "Stærk adgangskode",
"The Base DN appears to be wrong" : "Base DN synes at være forkert",
- "Testing configuration…" : "Test af konfiguration...",
- "Configuration incorrect" : "Indstilling forkert",
+ "Testing configuration…" : "Tester konfiguration...",
+ "Configuration incorrect" : "Konfiguration forkert",
"Configuration incomplete" : "Konfiguration ufuldstændig",
- "Configuration OK" : "Indstilling OK",
+ "Configuration OK" : "Konfiguration OK",
"Select groups" : "Vælg grupper",
"Select object classes" : "Vælg objektklasser",
"Please check the credentials, they seem to be wrong." : "Tjek venligst legitimationerne.",
@@ -33,7 +33,7 @@
"More than 1,000 directory entries available." : "Mere end 1.000 mappeindgange til rådighed.",
"_{objectsFound} entry available within the provided Base DN_::_{objectsFound} entries available within the provided Base DN_" : ["{objectsFound} indgang tilgængelig i den givne Base DN","{objectsFound} poster tilgængelige inden for den givne Base DN"],
"An error occurred. Please check the Base DN, as well as connection settings and credentials." : "Der opstod en fejl. Tjek venligst Base DN samt tilslutningsindstillinger og legitimationsoplysninger.",
- "Do you really want to delete the current Server Configuration?" : "Vil du virkelig slette den aktuelle serverindstilling?",
+ "Do you really want to delete the current Server Configuration?" : "Vil du virkelig slette den aktuelle server konfiguration?",
"Confirm Deletion" : "Bekræft sletning",
"Mappings cleared successfully!" : "Mappings ryddet med succes!",
"Error while clearing the mappings." : "Fejl under rydning af tilknytninger.",
@@ -44,7 +44,7 @@
"Mode switch" : "Tilstandsafbryder",
"Select attributes" : "Vælg attributter",
"User not found. Please check your login attributes and username. Effective filter (to copy-and-paste for command-line validation): <br/>" : "Brugeren ikke fundet. Tjek venligst dine login attributter og brugernavn. Effektiv filter (til copy- and - paste til kommandolinjevalidering): < br / >",
- "User found and settings verified." : "Brugerfundet og indstillinger verificeret.",
+ "User found and settings verified." : "Bruger fundet og indstillinger verificeret.",
"Consider narrowing your search, as it encompassed many users, only the first one of whom will be able to log in." : "Overvej at indsnævre din søgning, som det omfattede mange brugere, kun den første af dem vil være i stand til at logge ind.",
"An unspecified error occurred. Please check log and settings." : "En uspecificeret fejl opstod. Tjek log og indstillinger.",
"The search filter is invalid, probably due to syntax issues like uneven number of opened and closed brackets. Please revise." : "Søgefilteret er ugyldigt, sandsynligvis på grund af syntaksspørgsmål som ulige antal åbne og lukkede parenteser. Vær venlig at revidere.",
@@ -99,7 +99,7 @@
"When logging in, %s will find the user based on the following attributes:" : "Når du logger ind, vil %s finde brugeren baseret på følgende egenskaber:",
"LDAP/AD Username:" : "LDAP / AD Brugernavn:",
"Allows login against the LDAP/AD username, which is either \"uid\" or \"sAMAccountName\" and will be detected." : "Tillader login mod LDAP / AD brugernavn, som er enten \"uid\" eller \"SAMAccountName\" og vil blive opdaget.",
- "LDAP/AD Email Address:" : "LDAP / AD Email adresse:",
+ "LDAP/AD Email Address:" : "LDAP / AD E-mail adresse:",
"Allows login against an email attribute. \"mail\" and \"mailPrimaryAddress\" allowed." : "Tillader login mod en e- mail- attribut. \"mail\" og \"mailPrimaryAddress\" tilladt.",
"Other Attributes:" : "Andre attributter:",
"Defines the filter to apply, when login is attempted. \"%%uid\" replaces the username in the login action. Example: \"uid=%%uid\"" : "Definerer det filter der skal anvendes, når login er forsøgt. \"%% uid\" erstatter brugernavnet i login-handlingen. Eksempel: \"uid =%% uid\"",
@@ -129,7 +129,7 @@
"The most common object classes for users are organizationalPerson, person, user, and inetOrgPerson. If you are not sure which object class to select, please consult your directory admin." : "De mest almindelige objektklasser for brugere er organisationalPerson, person, bruger og inetOrgPerson. Hvis du ikke er sikker på hvilken objektklasse du skal vælge, bedes du konsultere din mappe- admin.",
"The filter specifies which LDAP users shall have access to the %s instance." : "Filteret angiver, hvilke LDAP-brugere der skal have adgang til %s instansen.",
"Verify settings and count users" : "Verificér indstillinger og tæller brugere",
- "Saving" : "Gemning",
+ "Saving" : "Gemmer",
"Back" : "Tilbage",
"Continue" : "Fortsæt",
"Please renew your password." : "Venligst forny din adgangskode.",
diff --git a/apps/user_status/tests/Unit/BackgroundJob/ClearOldStatusesBackgroundJobTest.php b/apps/user_status/tests/Unit/BackgroundJob/ClearOldStatusesBackgroundJobTest.php
index 90c85bcdaac..66142082343 100644
--- a/apps/user_status/tests/Unit/BackgroundJob/ClearOldStatusesBackgroundJobTest.php
+++ b/apps/user_status/tests/Unit/BackgroundJob/ClearOldStatusesBackgroundJobTest.php
@@ -11,18 +11,13 @@ namespace OCA\UserStatus\Tests\BackgroundJob;
use OCA\UserStatus\BackgroundJob\ClearOldStatusesBackgroundJob;
use OCA\UserStatus\Db\UserStatusMapper;
use OCP\AppFramework\Utility\ITimeFactory;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class ClearOldStatusesBackgroundJobTest extends TestCase {
-
- /** @var ITimeFactory|\PHPUnit\Framework\MockObject\MockObject */
- private $time;
-
- /** @var UserStatusMapper|\PHPUnit\Framework\MockObject\MockObject */
- private $mapper;
-
- /** @var ClearOldStatusesBackgroundJob */
- private $job;
+ private ITimeFactory&MockObject $time;
+ private UserStatusMapper&MockObject $mapper;
+ private ClearOldStatusesBackgroundJob $job;
protected function setUp(): void {
parent::setUp();
diff --git a/apps/user_status/tests/Unit/CapabilitiesTest.php b/apps/user_status/tests/Unit/CapabilitiesTest.php
index 9e72d49fe31..ef721eaa90b 100644
--- a/apps/user_status/tests/Unit/CapabilitiesTest.php
+++ b/apps/user_status/tests/Unit/CapabilitiesTest.php
@@ -10,15 +10,12 @@ namespace OCA\UserStatus\Tests;
use OCA\UserStatus\Capabilities;
use OCP\IEmojiHelper;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class CapabilitiesTest extends TestCase {
-
- /** @var IEmojiHelper|\PHPUnit\Framework\MockObject\MockObject */
- private $emojiHelper;
-
- /** @var Capabilities */
- private $capabilities;
+ private IEmojiHelper&MockObject $emojiHelper;
+ private Capabilities $capabilities;
protected function setUp(): void {
parent::setUp();
@@ -28,8 +25,6 @@ class CapabilitiesTest extends TestCase {
}
/**
- * @param bool $supportsEmojis
- *
* @dataProvider getCapabilitiesDataProvider
*/
public function testGetCapabilities(bool $supportsEmojis): void {
@@ -46,7 +41,7 @@ class CapabilitiesTest extends TestCase {
], $this->capabilities->getCapabilities());
}
- public function getCapabilitiesDataProvider(): array {
+ public static function getCapabilitiesDataProvider(): array {
return [
[true],
[false],
diff --git a/apps/user_status/tests/Unit/Connector/UserStatusProviderTest.php b/apps/user_status/tests/Unit/Connector/UserStatusProviderTest.php
index 7e2da883af4..df6c55488d5 100644
--- a/apps/user_status/tests/Unit/Connector/UserStatusProviderTest.php
+++ b/apps/user_status/tests/Unit/Connector/UserStatusProviderTest.php
@@ -11,15 +11,12 @@ namespace OCA\UserStatus\Tests\Connector;
use OCA\UserStatus\Connector\UserStatusProvider;
use OCA\UserStatus\Db\UserStatus;
use OCA\UserStatus\Service\StatusService;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class UserStatusProviderTest extends TestCase {
-
- /** @var \PHPUnit\Framework\MockObject\MockObject */
- private $service;
-
- /** @var UserStatusProvider */
- private $provider;
+ private StatusService&MockObject $service;
+ private UserStatusProvider $provider;
protected function setUp(): void {
parent::setUp();
diff --git a/apps/user_status/tests/Unit/Controller/PredefinedStatusControllerTest.php b/apps/user_status/tests/Unit/Controller/PredefinedStatusControllerTest.php
index 5709cdc89cf..0f96f41a524 100644
--- a/apps/user_status/tests/Unit/Controller/PredefinedStatusControllerTest.php
+++ b/apps/user_status/tests/Unit/Controller/PredefinedStatusControllerTest.php
@@ -11,15 +11,12 @@ namespace OCA\UserStatus\Tests\Controller;
use OCA\UserStatus\Controller\PredefinedStatusController;
use OCA\UserStatus\Service\PredefinedStatusService;
use OCP\IRequest;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class PredefinedStatusControllerTest extends TestCase {
-
- /** @var PredefinedStatusService|\PHPUnit\Framework\MockObject\MockObject */
- private $service;
-
- /** @var PredefinedStatusController */
- private $controller;
+ private PredefinedStatusService&MockObject $service;
+ private PredefinedStatusController $controller;
protected function setUp(): void {
parent::setUp();
@@ -27,8 +24,7 @@ class PredefinedStatusControllerTest extends TestCase {
$request = $this->createMock(IRequest::class);
$this->service = $this->createMock(PredefinedStatusService::class);
- $this->controller = new PredefinedStatusController('user_status', $request,
- $this->service);
+ $this->controller = new PredefinedStatusController('user_status', $request, $this->service);
}
public function testFindAll(): void {
diff --git a/apps/user_status/tests/Unit/Controller/StatusesControllerTest.php b/apps/user_status/tests/Unit/Controller/StatusesControllerTest.php
index fe3e1c56a7e..76d337879c3 100644
--- a/apps/user_status/tests/Unit/Controller/StatusesControllerTest.php
+++ b/apps/user_status/tests/Unit/Controller/StatusesControllerTest.php
@@ -14,15 +14,12 @@ use OCA\UserStatus\Service\StatusService;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\OCS\OCSNotFoundException;
use OCP\IRequest;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class StatusesControllerTest extends TestCase {
-
- /** @var StatusService|\PHPUnit\Framework\MockObject\MockObject */
- private $service;
-
- /** @var StatusesController */
- private $controller;
+ private StatusService&MockObject $service;
+ private StatusesController $controller;
protected function setUp(): void {
parent::setUp();
diff --git a/apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php b/apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php
index 26b29bcc74c..45ee9c4fdba 100644
--- a/apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php
+++ b/apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php
@@ -21,22 +21,16 @@ use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\OCS\OCSBadRequestException;
use OCP\AppFramework\OCS\OCSNotFoundException;
use OCP\IRequest;
+use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
use Test\TestCase;
use Throwable;
class UserStatusControllerTest extends TestCase {
- /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */
- private $logger;
-
- /** @var StatusService|\PHPUnit\Framework\MockObject\MockObject */
- private $statusService;
-
- /** @var CalendarStatusService|\PHPUnit\Framework\MockObject\MockObject $calendarStatusService */
- private $calendarStatusService;
-
- /** @var UserStatusController */
- private $controller;
+ private LoggerInterface&MockObject $logger;
+ private StatusService&MockObject $statusService;
+ private CalendarStatusService&MockObject $calendarStatusService;
+ private UserStatusController $controller;
protected function setUp(): void {
parent::setUp();
@@ -94,19 +88,10 @@ class UserStatusControllerTest extends TestCase {
}
/**
- * @param string $statusType
- * @param string|null $statusIcon
- * @param string|null $message
- * @param int|null $clearAt
- * @param bool $expectSuccess
- * @param bool $expectException
- * @param Throwable|null $exception
- * @param bool $expectLogger
- * @param string|null $expectedLogMessage
- *
* @dataProvider setStatusDataProvider
*/
- public function testSetStatus(string $statusType,
+ public function testSetStatus(
+ string $statusType,
?string $statusIcon,
?string $message,
?int $clearAt,
@@ -114,7 +99,8 @@ class UserStatusControllerTest extends TestCase {
bool $expectException,
?Throwable $exception,
bool $expectLogger,
- ?string $expectedLogMessage): void {
+ ?string $expectedLogMessage,
+ ): void {
$userStatus = $this->getUserStatus();
if ($expectException) {
@@ -155,7 +141,7 @@ class UserStatusControllerTest extends TestCase {
}
}
- public function setStatusDataProvider(): array {
+ public static function setStatusDataProvider(): array {
return [
['busy', '👨🏽‍💻', 'Busy developing the status feature', 500, true, false, null, false, null],
['busy', '👨🏽‍💻', 'Busy developing the status feature', 500, false, true, new InvalidStatusTypeException('Original exception message'), true,
@@ -164,23 +150,17 @@ class UserStatusControllerTest extends TestCase {
}
/**
- * @param string $messageId
- * @param int|null $clearAt
- * @param bool $expectSuccess
- * @param bool $expectException
- * @param Throwable|null $exception
- * @param bool $expectLogger
- * @param string|null $expectedLogMessage
- *
* @dataProvider setPredefinedMessageDataProvider
*/
- public function testSetPredefinedMessage(string $messageId,
+ public function testSetPredefinedMessage(
+ string $messageId,
?int $clearAt,
bool $expectSuccess,
bool $expectException,
?Throwable $exception,
bool $expectLogger,
- ?string $expectedLogMessage): void {
+ ?string $expectedLogMessage,
+ ): void {
$userStatus = $this->getUserStatus();
if ($expectException) {
@@ -221,7 +201,7 @@ class UserStatusControllerTest extends TestCase {
}
}
- public function setPredefinedMessageDataProvider(): array {
+ public static function setPredefinedMessageDataProvider(): array {
return [
['messageId-42', 500, true, false, null, false, null],
['messageId-42', 500, false, true, new InvalidClearAtException('Original exception message'), true,
@@ -232,19 +212,10 @@ class UserStatusControllerTest extends TestCase {
}
/**
- * @param string|null $statusIcon
- * @param string $message
- * @param int|null $clearAt
- * @param bool $expectSuccess
- * @param bool $expectException
- * @param Throwable|null $exception
- * @param bool $expectLogger
- * @param string|null $expectedLogMessage
- * @param bool $expectSuccessAsReset
- *
* @dataProvider setCustomMessageDataProvider
*/
- public function testSetCustomMessage(?string $statusIcon,
+ public function testSetCustomMessage(
+ ?string $statusIcon,
string $message,
?int $clearAt,
bool $expectSuccess,
@@ -252,7 +223,8 @@ class UserStatusControllerTest extends TestCase {
?Throwable $exception,
bool $expectLogger,
?string $expectedLogMessage,
- bool $expectSuccessAsReset = false): void {
+ bool $expectSuccessAsReset = false,
+ ): void {
$userStatus = $this->getUserStatus();
if ($expectException) {
@@ -308,7 +280,7 @@ class UserStatusControllerTest extends TestCase {
}
}
- public function setCustomMessageDataProvider(): array {
+ public static function setCustomMessageDataProvider(): array {
return [
['👨🏽‍💻', 'Busy developing the status feature', 500, true, false, null, false, null],
['👨🏽‍💻', '', 500, true, false, null, false, null, false],
diff --git a/apps/user_status/tests/Unit/Dashboard/UserStatusWidgetTest.php b/apps/user_status/tests/Unit/Dashboard/UserStatusWidgetTest.php
index e776837fac8..8773b04c95f 100644
--- a/apps/user_status/tests/Unit/Dashboard/UserStatusWidgetTest.php
+++ b/apps/user_status/tests/Unit/Dashboard/UserStatusWidgetTest.php
@@ -16,33 +16,18 @@ use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\IUserManager;
use OCP\IUserSession;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class UserStatusWidgetTest extends TestCase {
-
- /** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */
- private $l10n;
-
- /** @var IDateTimeFormatter|\PHPUnit\Framework\MockObject\MockObject */
- private $dateTimeFormatter;
-
- /** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */
- private $urlGenerator;
-
- /** @var IInitialState|\PHPUnit\Framework\MockObject\MockObject */
- private $initialState;
-
- /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */
- private $userManager;
-
- /** @var IUserSession|\PHPUnit\Framework\MockObject\MockObject */
- private $userSession;
-
- /** @var StatusService|\PHPUnit\Framework\MockObject\MockObject */
- private $service;
-
- /** @var UserStatusWidget */
- private $widget;
+ private IL10N&MockObject $l10n;
+ private IDateTimeFormatter&MockObject $dateTimeFormatter;
+ private IURLGenerator&MockObject $urlGenerator;
+ private IInitialState&MockObject $initialState;
+ private IUserManager&MockObject $userManager;
+ private IUserSession&MockObject $userSession;
+ private StatusService&MockObject $service;
+ private UserStatusWidget $widget;
protected function setUp(): void {
parent::setUp();
diff --git a/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php b/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php
index 46147c6a822..c9bda492210 100644
--- a/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php
+++ b/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php
@@ -15,9 +15,7 @@ use OCP\DB\Exception;
use Test\TestCase;
class UserStatusMapperTest extends TestCase {
-
- /** @var UserStatusMapper */
- private $mapper;
+ private UserStatusMapper $mapper;
protected function setUp(): void {
parent::setUp();
@@ -137,11 +135,6 @@ class UserStatusMapperTest extends TestCase {
}
/**
- * @param string $status
- * @param bool $isUserDefined
- * @param int $timestamp
- * @param bool $expectsClean
- *
* @dataProvider clearStatusesOlderThanDataProvider
*/
public function testClearStatusesOlderThan(string $status, bool $isUserDefined, int $timestamp, bool $expectsClean): void {
@@ -169,7 +162,7 @@ class UserStatusMapperTest extends TestCase {
}
}
- public function clearStatusesOlderThanDataProvider(): array {
+ public static function clearStatusesOlderThanDataProvider(): array {
return [
['offline', false, 6000, false],
['online', true, 6000, false],
@@ -231,7 +224,7 @@ class UserStatusMapperTest extends TestCase {
$this->mapper->insert($userStatus3);
}
- public function dataCreateBackupStatus(): array {
+ public static function dataCreateBackupStatus(): array {
return [
[false, false, false],
[true, false, true],
@@ -242,9 +235,6 @@ class UserStatusMapperTest extends TestCase {
/**
* @dataProvider dataCreateBackupStatus
- * @param bool $hasStatus
- * @param bool $hasBackup
- * @param bool $backupCreated
*/
public function testCreateBackupStatus(bool $hasStatus, bool $hasBackup, bool $backupCreated): void {
if ($hasStatus) {
diff --git a/apps/user_status/tests/Unit/Listener/UserDeletedListenerTest.php b/apps/user_status/tests/Unit/Listener/UserDeletedListenerTest.php
index 128b5c78c48..fbcea23338d 100644
--- a/apps/user_status/tests/Unit/Listener/UserDeletedListenerTest.php
+++ b/apps/user_status/tests/Unit/Listener/UserDeletedListenerTest.php
@@ -13,15 +13,12 @@ use OCA\UserStatus\Service\StatusService;
use OCP\EventDispatcher\GenericEvent;
use OCP\IUser;
use OCP\User\Events\UserDeletedEvent;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class UserDeletedListenerTest extends TestCase {
-
- /** @var StatusService|\PHPUnit\Framework\MockObject\MockObject */
- private $service;
-
- /** @var UserDeletedListener */
- private $listener;
+ private StatusService&MockObject $service;
+ private UserDeletedListener $listener;
protected function setUp(): void {
parent::setUp();
diff --git a/apps/user_status/tests/Unit/Listener/UserLiveStatusListenerTest.php b/apps/user_status/tests/Unit/Listener/UserLiveStatusListenerTest.php
index 421cce046df..c94315a7a93 100644
--- a/apps/user_status/tests/Unit/Listener/UserLiveStatusListenerTest.php
+++ b/apps/user_status/tests/Unit/Listener/UserLiveStatusListenerTest.php
@@ -11,7 +11,6 @@ namespace OCA\UserStatus\Tests\Listener;
use OCA\DAV\CalDAV\Status\StatusService as CalendarStatusService;
use OCA\UserStatus\Db\UserStatus;
use OCA\UserStatus\Db\UserStatusMapper;
-use OCA\UserStatus\Listener\UserDeletedListener;
use OCA\UserStatus\Listener\UserLiveStatusListener;
use OCA\UserStatus\Service\StatusService;
use OCP\AppFramework\Db\DoesNotExistException;
@@ -24,20 +23,13 @@ use Psr\Log\LoggerInterface;
use Test\TestCase;
class UserLiveStatusListenerTest extends TestCase {
+ private UserStatusMapper&MockObject $mapper;
+ private StatusService&MockObject $statusService;
+ private ITimeFactory&MockObject $timeFactory;
+ private CalendarStatusService&MockObject $calendarStatusService;
- /** @var UserStatusMapper|MockObject */
- private $mapper;
- /** @var StatusService|MockObject */
- private $statusService;
- /** @var ITimeFactory|MockObject */
- private $timeFactory;
-
- /** @var UserDeletedListener */
- private $listener;
-
- private CalendarStatusService|MockObject $calendarStatusService;
-
- private LoggerInterface|MockObject $logger;
+ private LoggerInterface&MockObject $logger;
+ private UserLiveStatusListener $listener;
protected function setUp(): void {
parent::setUp();
@@ -58,25 +50,18 @@ class UserLiveStatusListenerTest extends TestCase {
}
/**
- * @param string $userId
- * @param string $previousStatus
- * @param int $previousTimestamp
- * @param bool $previousIsUserDefined
- * @param string $eventStatus
- * @param int $eventTimestamp
- * @param bool $expectExisting
- * @param bool $expectUpdate
- *
* @dataProvider handleEventWithCorrectEventDataProvider
*/
- public function testHandleWithCorrectEvent(string $userId,
+ public function testHandleWithCorrectEvent(
+ string $userId,
string $previousStatus,
int $previousTimestamp,
bool $previousIsUserDefined,
string $eventStatus,
int $eventTimestamp,
bool $expectExisting,
- bool $expectUpdate): void {
+ bool $expectUpdate,
+ ): void {
$userStatus = new UserStatus();
if ($expectExisting) {
@@ -143,7 +128,7 @@ class UserLiveStatusListenerTest extends TestCase {
}
}
- public function handleEventWithCorrectEventDataProvider(): array {
+ public static function handleEventWithCorrectEventDataProvider(): array {
return [
['john.doe', 'offline', 0, false, 'online', 5000, true, true],
['john.doe', 'offline', 0, false, 'online', 5000, false, true],
diff --git a/apps/user_status/tests/Unit/Service/PredefinedStatusServiceTest.php b/apps/user_status/tests/Unit/Service/PredefinedStatusServiceTest.php
index 12b34ed0b4d..091466637f0 100644
--- a/apps/user_status/tests/Unit/Service/PredefinedStatusServiceTest.php
+++ b/apps/user_status/tests/Unit/Service/PredefinedStatusServiceTest.php
@@ -10,15 +10,12 @@ namespace OCA\UserStatus\Tests\Service;
use OCA\UserStatus\Service\PredefinedStatusService;
use OCP\IL10N;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class PredefinedStatusServiceTest extends TestCase {
-
- /** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */
- protected $l10n;
-
- /** @var PredefinedStatusService */
- protected $service;
+ protected IL10N&MockObject $l10n;
+ protected PredefinedStatusService $service;
protected function setUp(): void {
parent::setUp();
@@ -97,9 +94,6 @@ class PredefinedStatusServiceTest extends TestCase {
}
/**
- * @param string $id
- * @param string|null $expectedIcon
- *
* @dataProvider getIconForIdDataProvider
*/
public function testGetIconForId(string $id, ?string $expectedIcon): void {
@@ -107,10 +101,7 @@ class PredefinedStatusServiceTest extends TestCase {
$this->assertEquals($expectedIcon, $actual);
}
- /**
- * @return array
- */
- public function getIconForIdDataProvider(): array {
+ public static function getIconForIdDataProvider(): array {
return [
['meeting', '📅'],
['commuting', '🚌'],
@@ -123,9 +114,6 @@ class PredefinedStatusServiceTest extends TestCase {
}
/**
- * @param string $id
- * @param string|null $expected
- *
* @dataProvider getTranslatedStatusForIdDataProvider
*/
public function testGetTranslatedStatusForId(string $id, ?string $expected): void {
@@ -136,10 +124,7 @@ class PredefinedStatusServiceTest extends TestCase {
$this->assertEquals($expected, $actual);
}
- /**
- * @return array
- */
- public function getTranslatedStatusForIdDataProvider(): array {
+ public static function getTranslatedStatusForIdDataProvider(): array {
return [
['meeting', 'In a meeting'],
['commuting', 'Commuting'],
@@ -152,9 +137,6 @@ class PredefinedStatusServiceTest extends TestCase {
}
/**
- * @param string $id
- * @param bool $expected
- *
* @dataProvider isValidIdDataProvider
*/
public function testIsValidId(string $id, bool $expected): void {
@@ -162,10 +144,7 @@ class PredefinedStatusServiceTest extends TestCase {
$this->assertEquals($expected, $actual);
}
- /**
- * @return array
- */
- public function isValidIdDataProvider(): array {
+ public static function isValidIdDataProvider(): array {
return [
['meeting', true],
['commuting', true],
diff --git a/apps/user_status/tests/Unit/Service/StatusServiceTest.php b/apps/user_status/tests/Unit/Service/StatusServiceTest.php
index 801d0cea0fc..7aeb1d48448 100644
--- a/apps/user_status/tests/Unit/Service/StatusServiceTest.php
+++ b/apps/user_status/tests/Unit/Service/StatusServiceTest.php
@@ -31,27 +31,13 @@ use Psr\Log\LoggerInterface;
use Test\TestCase;
class StatusServiceTest extends TestCase {
-
- /** @var UserStatusMapper|MockObject */
- private $mapper;
-
- /** @var ITimeFactory|MockObject */
- private $timeFactory;
-
- /** @var PredefinedStatusService|MockObject */
- private $predefinedStatusService;
-
- /** @var IEmojiHelper|MockObject */
- private $emojiHelper;
-
- /** @var IConfig|MockObject */
- private $config;
-
- /** @var IUserManager|MockObject */
- private $userManager;
-
- /** @var LoggerInterface|MockObject */
- private $logger;
+ private UserStatusMapper&MockObject $mapper;
+ private ITimeFactory&MockObject $timeFactory;
+ private PredefinedStatusService&MockObject $predefinedStatusService;
+ private IEmojiHelper&MockObject $emojiHelper;
+ private IConfig&MockObject $config;
+ private IUserManager&MockObject $userManager;
+ private LoggerInterface&MockObject $logger;
private StatusService $service;
@@ -236,20 +222,10 @@ class StatusServiceTest extends TestCase {
}
/**
- * @param string $userId
- * @param string $status
- * @param int|null $statusTimestamp
- * @param bool $isUserDefined
- * @param bool $expectExisting
- * @param bool $expectSuccess
- * @param bool $expectTimeFactory
- * @param bool $expectException
- * @param string|null $expectedExceptionClass
- * @param string|null $expectedExceptionMessage
- *
* @dataProvider setStatusDataProvider
*/
- public function testSetStatus(string $userId,
+ public function testSetStatus(
+ string $userId,
string $status,
?int $statusTimestamp,
bool $isUserDefined,
@@ -258,7 +234,8 @@ class StatusServiceTest extends TestCase {
bool $expectTimeFactory,
bool $expectException,
?string $expectedExceptionClass,
- ?string $expectedExceptionMessage): void {
+ ?string $expectedExceptionMessage,
+ ): void {
$userStatus = new UserStatus();
if ($expectExisting) {
@@ -309,7 +286,7 @@ class StatusServiceTest extends TestCase {
}
}
- public function setStatusDataProvider(): array {
+ public static function setStatusDataProvider(): array {
return [
['john.doe', 'online', 50, true, true, true, false, false, null, null],
['john.doe', 'online', 50, true, false, true, false, false, null, null],
@@ -368,19 +345,10 @@ class StatusServiceTest extends TestCase {
}
/**
- * @param string $userId
- * @param string $messageId
- * @param bool $isValidMessageId
- * @param int|null $clearAt
- * @param bool $expectExisting
- * @param bool $expectSuccess
- * @param bool $expectException
- * @param string|null $expectedExceptionClass
- * @param string|null $expectedExceptionMessage
- *
* @dataProvider setPredefinedMessageDataProvider
*/
- public function testSetPredefinedMessage(string $userId,
+ public function testSetPredefinedMessage(
+ string $userId,
string $messageId,
bool $isValidMessageId,
?int $clearAt,
@@ -388,7 +356,8 @@ class StatusServiceTest extends TestCase {
bool $expectSuccess,
bool $expectException,
?string $expectedExceptionClass,
- ?string $expectedExceptionMessage): void {
+ ?string $expectedExceptionMessage,
+ ): void {
$userStatus = new UserStatus();
if ($expectExisting) {
@@ -451,7 +420,7 @@ class StatusServiceTest extends TestCase {
}
}
- public function setPredefinedMessageDataProvider(): array {
+ public static function setPredefinedMessageDataProvider(): array {
return [
['john.doe', 'sick-leave', true, null, true, true, false, null, null],
['john.doe', 'sick-leave', true, null, false, true, false, null, null],
@@ -465,20 +434,10 @@ class StatusServiceTest extends TestCase {
}
/**
- * @param string $userId
- * @param string|null $statusIcon
- * @param bool $supportsEmoji
- * @param string $message
- * @param int|null $clearAt
- * @param bool $expectExisting
- * @param bool $expectSuccess
- * @param bool $expectException
- * @param string|null $expectedExceptionClass
- * @param string|null $expectedExceptionMessage
- *
* @dataProvider setCustomMessageDataProvider
*/
- public function testSetCustomMessage(string $userId,
+ public function testSetCustomMessage(
+ string $userId,
?string $statusIcon,
bool $supportsEmoji,
string $message,
@@ -487,7 +446,8 @@ class StatusServiceTest extends TestCase {
bool $expectSuccess,
bool $expectException,
?string $expectedExceptionClass,
- ?string $expectedExceptionMessage): void {
+ ?string $expectedExceptionMessage,
+ ): void {
$userStatus = new UserStatus();
if ($expectExisting) {
@@ -548,7 +508,7 @@ class StatusServiceTest extends TestCase {
}
}
- public function setCustomMessageDataProvider(): array {
+ public static function setCustomMessageDataProvider(): array {
return [
['john.doe', '😁', true, 'Custom message', null, true, true, false, null, null],
['john.doe', '😁', true, 'Custom message', null, false, true, false, null, null],
@@ -815,7 +775,7 @@ class StatusServiceTest extends TestCase {
$this->service->revertMultipleUserStatus(['john', 'nobackup', 'backuponly', 'nobackupanddnd'], 'call');
}
- public function dataSetUserStatus(): array {
+ public static function dataSetUserStatus(): array {
return [
[IUserStatus::MESSAGE_CALENDAR_BUSY, '', false],
diff --git a/apps/webhook_listeners/tests/Db/WebhookListenerMapperTest.php b/apps/webhook_listeners/tests/Db/WebhookListenerMapperTest.php
index be99bccb677..45d66090eae 100644
--- a/apps/webhook_listeners/tests/Db/WebhookListenerMapperTest.php
+++ b/apps/webhook_listeners/tests/Db/WebhookListenerMapperTest.php
@@ -44,7 +44,7 @@ class WebhookListenerMapperTest extends TestCase {
parent::tearDown();
}
- protected function pruneTables() {
+ protected function pruneTables(): void {
$query = $this->connection->getQueryBuilder();
$query->delete(WebhookListenerMapper::TABLE_NAME)->executeStatement();
}
diff --git a/apps/workflowengine/tests/Check/AbstractStringCheckTest.php b/apps/workflowengine/tests/Check/AbstractStringCheckTest.php
index 774f866bf12..d10fcfb4cc3 100644
--- a/apps/workflowengine/tests/Check/AbstractStringCheckTest.php
+++ b/apps/workflowengine/tests/Check/AbstractStringCheckTest.php
@@ -1,4 +1,7 @@
<?php
+
+declare(strict_types=1);
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -7,9 +10,10 @@ namespace OCA\WorkflowEngine\Tests\Check;
use OCA\WorkflowEngine\Check\AbstractStringCheck;
use OCP\IL10N;
+use PHPUnit\Framework\MockObject\MockObject;
class AbstractStringCheckTest extends \Test\TestCase {
- protected function getCheckMock() {
+ protected function getCheckMock(): AbstractStringCheck|MockObject {
$l = $this->getMockBuilder(IL10N::class)
->disableOriginalConstructor()
->getMock();
@@ -19,7 +23,7 @@ class AbstractStringCheckTest extends \Test\TestCase {
return sprintf($string, $args);
});
- $check = $this->getMockBuilder('OCA\WorkflowEngine\Check\AbstractStringCheck')
+ $check = $this->getMockBuilder(AbstractStringCheck::class)
->setConstructorArgs([
$l,
])
@@ -32,7 +36,7 @@ class AbstractStringCheckTest extends \Test\TestCase {
return $check;
}
- public function dataExecuteStringCheck() {
+ public static function dataExecuteStringCheck(): array {
return [
['is', 'same', 'same', true],
['is', 'different', 'not the same', false],
@@ -48,19 +52,15 @@ class AbstractStringCheckTest extends \Test\TestCase {
/**
* @dataProvider dataExecuteStringCheck
- * @param string $operation
- * @param string $checkValue
- * @param string $actualValue
- * @param bool $expected
*/
- public function testExecuteStringCheck($operation, $checkValue, $actualValue, $expected): void {
+ public function testExecuteStringCheck(string $operation, string $checkValue, string $actualValue, bool $expected): void {
$check = $this->getCheckMock();
/** @var AbstractStringCheck $check */
$this->assertEquals($expected, $this->invokePrivate($check, 'executeStringCheck', [$operation, $checkValue, $actualValue]));
}
- public function dataValidateCheck() {
+ public static function dataValidateCheck(): array {
return [
['is', '/Invalid(Regex/'],
['!is', '/Invalid(Regex/'],
@@ -71,10 +71,8 @@ class AbstractStringCheckTest extends \Test\TestCase {
/**
* @dataProvider dataValidateCheck
- * @param string $operator
- * @param string $value
*/
- public function testValidateCheck($operator, $value): void {
+ public function testValidateCheck(string $operator, string $value): void {
$check = $this->getCheckMock();
/** @var AbstractStringCheck $check */
@@ -83,7 +81,7 @@ class AbstractStringCheckTest extends \Test\TestCase {
$this->addToAssertionCount(1);
}
- public function dataValidateCheckInvalid() {
+ public static function dataValidateCheckInvalid(): array {
return [
['!!is', '', 1, 'The given operator is invalid'],
['less', '', 1, 'The given operator is invalid'],
@@ -94,12 +92,8 @@ class AbstractStringCheckTest extends \Test\TestCase {
/**
* @dataProvider dataValidateCheckInvalid
- * @param $operator
- * @param $value
- * @param $exceptionCode
- * @param $exceptionMessage
*/
- public function testValidateCheckInvalid($operator, $value, $exceptionCode, $exceptionMessage): void {
+ public function testValidateCheckInvalid(string $operator, string $value, int $exceptionCode, string $exceptionMessage): void {
$check = $this->getCheckMock();
try {
@@ -111,7 +105,7 @@ class AbstractStringCheckTest extends \Test\TestCase {
}
}
- public function dataMatch() {
+ public static function dataMatch(): array {
return [
['/valid/', 'valid', [], true],
['/valid/', 'valid', [md5('/valid/') => [md5('valid') => false]], false], // Cache hit
@@ -120,12 +114,8 @@ class AbstractStringCheckTest extends \Test\TestCase {
/**
* @dataProvider dataMatch
- * @param string $pattern
- * @param string $subject
- * @param array[] $matches
- * @param bool $expected
*/
- public function testMatch($pattern, $subject, $matches, $expected): void {
+ public function testMatch(string $pattern, string $subject, array $matches, bool $expected): void {
$check = $this->getCheckMock();
$this->invokePrivate($check, 'matches', [$matches]);
diff --git a/apps/workflowengine/tests/Check/RequestRemoteAddressTest.php b/apps/workflowengine/tests/Check/RequestRemoteAddressTest.php
index 47b9138819e..f2f8026e666 100644
--- a/apps/workflowengine/tests/Check/RequestRemoteAddressTest.php
+++ b/apps/workflowengine/tests/Check/RequestRemoteAddressTest.php
@@ -1,4 +1,7 @@
<?php
+
+declare(strict_types=1);
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -8,19 +11,14 @@ namespace OCA\WorkflowEngine\Tests\Check;
use OCA\WorkflowEngine\Check\RequestRemoteAddress;
use OCP\IL10N;
use OCP\IRequest;
+use PHPUnit\Framework\MockObject\MockObject;
class RequestRemoteAddressTest extends \Test\TestCase {
- /** @var IRequest|\PHPUnit\Framework\MockObject\MockObject */
- protected $request;
+ protected IRequest&MockObject $request;
- /**
- * @return IL10N|\PHPUnit\Framework\MockObject\MockObject
- */
- protected function getL10NMock() {
- $l = $this->getMockBuilder(IL10N::class)
- ->disableOriginalConstructor()
- ->getMock();
+ protected function getL10NMock(): IL10N&MockObject {
+ $l = $this->createMock(IL10N::class);
$l->expects($this->any())
->method('t')
->willReturnCallback(function ($string, $args) {
@@ -32,11 +30,10 @@ class RequestRemoteAddressTest extends \Test\TestCase {
protected function setUp(): void {
parent::setUp();
- $this->request = $this->getMockBuilder(IRequest::class)
- ->getMock();
+ $this->request = $this->createMock(IRequest::class);
}
- public function dataExecuteCheckIPv4() {
+ public static function dataExecuteCheckIPv4(): array {
return [
['127.0.0.1/32', '127.0.0.1', true],
['127.0.0.1/32', '127.0.0.0', false],
@@ -49,11 +46,8 @@ class RequestRemoteAddressTest extends \Test\TestCase {
/**
* @dataProvider dataExecuteCheckIPv4
- * @param string $value
- * @param string $ip
- * @param bool $expected
*/
- public function testExecuteCheckMatchesIPv4($value, $ip, $expected): void {
+ public function testExecuteCheckMatchesIPv4(string $value, string $ip, bool $expected): void {
$check = new RequestRemoteAddress($this->getL10NMock(), $this->request);
$this->request->expects($this->once())
@@ -65,11 +59,8 @@ class RequestRemoteAddressTest extends \Test\TestCase {
/**
* @dataProvider dataExecuteCheckIPv4
- * @param string $value
- * @param string $ip
- * @param bool $expected
*/
- public function testExecuteCheckNotMatchesIPv4($value, $ip, $expected): void {
+ public function testExecuteCheckNotMatchesIPv4(string $value, string $ip, bool $expected): void {
$check = new RequestRemoteAddress($this->getL10NMock(), $this->request);
$this->request->expects($this->once())
@@ -79,7 +70,7 @@ class RequestRemoteAddressTest extends \Test\TestCase {
$this->assertEquals(!$expected, $check->executeCheck('!matchesIPv4', $value));
}
- public function dataExecuteCheckIPv6() {
+ public static function dataExecuteCheckIPv6(): array {
return [
['::1/128', '::1', true],
['::2/128', '::3', false],
@@ -93,11 +84,8 @@ class RequestRemoteAddressTest extends \Test\TestCase {
/**
* @dataProvider dataExecuteCheckIPv6
- * @param string $value
- * @param string $ip
- * @param bool $expected
*/
- public function testExecuteCheckMatchesIPv6($value, $ip, $expected): void {
+ public function testExecuteCheckMatchesIPv6(string $value, string $ip, bool $expected): void {
$check = new RequestRemoteAddress($this->getL10NMock(), $this->request);
$this->request->expects($this->once())
@@ -109,11 +97,8 @@ class RequestRemoteAddressTest extends \Test\TestCase {
/**
* @dataProvider dataExecuteCheckIPv6
- * @param string $value
- * @param string $ip
- * @param bool $expected
*/
- public function testExecuteCheckNotMatchesIPv6($value, $ip, $expected): void {
+ public function testExecuteCheckNotMatchesIPv6(string $value, string $ip, bool $expected): void {
$check = new RequestRemoteAddress($this->getL10NMock(), $this->request);
$this->request->expects($this->once())
diff --git a/apps/workflowengine/tests/Check/RequestTimeTest.php b/apps/workflowengine/tests/Check/RequestTimeTest.php
index 6b56bb9427a..21127d4d56e 100644
--- a/apps/workflowengine/tests/Check/RequestTimeTest.php
+++ b/apps/workflowengine/tests/Check/RequestTimeTest.php
@@ -1,4 +1,7 @@
<?php
+
+declare(strict_types=1);
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -8,19 +11,13 @@ namespace OCA\WorkflowEngine\Tests\Check;
use OCA\WorkflowEngine\Check\RequestTime;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\IL10N;
+use PHPUnit\Framework\MockObject\MockObject;
class RequestTimeTest extends \Test\TestCase {
+ protected ITimeFactory&MockObject $timeFactory;
- /** @var ITimeFactory|\PHPUnit\Framework\MockObject\MockObject */
- protected $timeFactory;
-
- /**
- * @return IL10N|\PHPUnit\Framework\MockObject\MockObject
- */
- protected function getL10NMock() {
- $l = $this->getMockBuilder(IL10N::class)
- ->disableOriginalConstructor()
- ->getMock();
+ protected function getL10NMock(): IL10N&MockObject {
+ $l = $this->createMock(IL10N::class);
$l->expects($this->any())
->method('t')
->willReturnCallback(function ($string, $args) {
@@ -32,11 +29,10 @@ class RequestTimeTest extends \Test\TestCase {
protected function setUp(): void {
parent::setUp();
- $this->timeFactory = $this->getMockBuilder('OCP\AppFramework\Utility\ITimeFactory')
- ->getMock();
+ $this->timeFactory = $this->createMock(ITimeFactory::class);
}
- public function dataExecuteCheck() {
+ public static function dataExecuteCheck(): array {
return [
[json_encode(['08:00 Europe/Berlin', '17:00 Europe/Berlin']), 1467870105, false], // 2016-07-07T07:41:45+02:00
[json_encode(['08:00 Europe/Berlin', '17:00 Europe/Berlin']), 1467873705, true], // 2016-07-07T08:41:45+02:00
@@ -69,11 +65,8 @@ class RequestTimeTest extends \Test\TestCase {
/**
* @dataProvider dataExecuteCheck
- * @param string $value
- * @param int $timestamp
- * @param bool $expected
*/
- public function testExecuteCheckIn($value, $timestamp, $expected): void {
+ public function testExecuteCheckIn(string $value, int $timestamp, bool $expected): void {
$check = new RequestTime($this->getL10NMock(), $this->timeFactory);
$this->timeFactory->expects($this->once())
@@ -85,11 +78,8 @@ class RequestTimeTest extends \Test\TestCase {
/**
* @dataProvider dataExecuteCheck
- * @param string $value
- * @param int $timestamp
- * @param bool $expected
*/
- public function testExecuteCheckNotIn($value, $timestamp, $expected): void {
+ public function testExecuteCheckNotIn(string $value, int $timestamp, bool $expected): void {
$check = new RequestTime($this->getL10NMock(), $this->timeFactory);
$this->timeFactory->expects($this->once())
@@ -99,7 +89,7 @@ class RequestTimeTest extends \Test\TestCase {
$this->assertEquals(!$expected, $check->executeCheck('!in', $value));
}
- public function dataValidateCheck() {
+ public static function dataValidateCheck(): array {
return [
['in', '["08:00 Europe/Berlin","17:00 Europe/Berlin"]'],
['!in', '["08:00 Europe/Berlin","17:00 America/North_Dakota/Beulah"]'],
@@ -109,16 +99,14 @@ class RequestTimeTest extends \Test\TestCase {
/**
* @dataProvider dataValidateCheck
- * @param string $operator
- * @param string $value
*/
- public function testValidateCheck($operator, $value): void {
+ public function testValidateCheck(string $operator, string $value): void {
$check = new RequestTime($this->getL10NMock(), $this->timeFactory);
$check->validateCheck($operator, $value);
$this->addToAssertionCount(1);
}
- public function dataValidateCheckInvalid() {
+ public static function dataValidateCheckInvalid(): array {
return [
['!!in', '["08:00 Europe/Berlin","17:00 Europe/Berlin"]', 1, 'The given operator is invalid'],
['in', '["28:00 Europe/Berlin","17:00 Europe/Berlin"]', 2, 'The given time span is invalid'],
@@ -132,12 +120,8 @@ class RequestTimeTest extends \Test\TestCase {
/**
* @dataProvider dataValidateCheckInvalid
- * @param string $operator
- * @param string $value
- * @param int $exceptionCode
- * @param string $exceptionMessage
*/
- public function testValidateCheckInvalid($operator, $value, $exceptionCode, $exceptionMessage): void {
+ public function testValidateCheckInvalid(string $operator, string $value, int $exceptionCode, string $exceptionMessage): void {
$check = new RequestTime($this->getL10NMock(), $this->timeFactory);
try {
diff --git a/apps/workflowengine/tests/Check/RequestUserAgentTest.php b/apps/workflowengine/tests/Check/RequestUserAgentTest.php
index 30e389c8236..2fe96bf3bdb 100644
--- a/apps/workflowengine/tests/Check/RequestUserAgentTest.php
+++ b/apps/workflowengine/tests/Check/RequestUserAgentTest.php
@@ -1,4 +1,7 @@
<?php
+
+declare(strict_types=1);
+
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -9,24 +12,19 @@ use OCA\WorkflowEngine\Check\AbstractStringCheck;
use OCA\WorkflowEngine\Check\RequestUserAgent;
use OCP\IL10N;
use OCP\IRequest;
+use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
class RequestUserAgentTest extends TestCase {
-
- /** @var IRequest|\PHPUnit\Framework\MockObject\MockObject */
- protected $request;
-
- /** @var RequestUserAgent */
- protected $check;
+ protected IRequest&MockObject $request;
+ protected RequestUserAgent $check;
protected function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
- /** @var IL10N|\PHPUnit\Framework\MockObject\MockObject $l */
- $l = $this->getMockBuilder(IL10N::class)
- ->disableOriginalConstructor()
- ->getMock();
+ /** @var IL10N&MockObject $l */
+ $l = $this->createMock(IL10N::class);
$l->expects($this->any())
->method('t')
->willReturnCallback(function ($string, $args) {
@@ -36,7 +34,7 @@ class RequestUserAgentTest extends TestCase {
$this->check = new RequestUserAgent($l, $this->request);
}
- public function dataExecuteCheck() {
+ public static function dataExecuteCheck(): array {
return [
['is', 'android', 'Mozilla/5.0 (Android) Nextcloud-android/2.2.0', true],
['is', 'android', 'Mozilla/5.0 (iOS) Nextcloud-iOS/2.2.0', false],
@@ -86,12 +84,8 @@ class RequestUserAgentTest extends TestCase {
/**
* @dataProvider dataExecuteCheck
- * @param string $operation
- * @param string $checkValue
- * @param string $actualValue
- * @param bool $expected
*/
- public function testExecuteCheck($operation, $checkValue, $actualValue, $expected): void {
+ public function testExecuteCheck(string $operation, string $checkValue, string $actualValue, bool $expected): void {
$this->request->expects($this->once())
->method('getHeader')
->willReturn($actualValue);