aboutsummaryrefslogtreecommitdiffstats
path: root/apps/comments/tests
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2024-09-15 22:32:31 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2024-09-15 22:32:31 +0200
commit49dd79eabb2b8902559a7a4e8f8fcad54f46b604 (patch)
tree2af18db46ba463368dc4461d7436fb69577923de /apps/comments/tests
parent4281ce6fa1bb8235426099d720734d2394bec203 (diff)
downloadnextcloud-server-49dd79eabb2b8902559a7a4e8f8fcad54f46b604.tar.gz
nextcloud-server-49dd79eabb2b8902559a7a4e8f8fcad54f46b604.zip
refactor: Add void return type to PHPUnit test methods
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/comments/tests')
-rw-r--r--apps/comments/tests/Unit/Activity/ListenerTest.php2
-rw-r--r--apps/comments/tests/Unit/AppInfo/ApplicationTest.php2
-rw-r--r--apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php2
-rw-r--r--apps/comments/tests/Unit/Controller/NotificationsTest.php8
-rw-r--r--apps/comments/tests/Unit/EventHandlerTest.php4
-rw-r--r--apps/comments/tests/Unit/Notification/ListenerTest.php6
-rw-r--r--apps/comments/tests/Unit/Notification/NotifierTest.php14
7 files changed, 19 insertions, 19 deletions
diff --git a/apps/comments/tests/Unit/Activity/ListenerTest.php b/apps/comments/tests/Unit/Activity/ListenerTest.php
index c1606aee745..19dcae4c8ab 100644
--- a/apps/comments/tests/Unit/Activity/ListenerTest.php
+++ b/apps/comments/tests/Unit/Activity/ListenerTest.php
@@ -65,7 +65,7 @@ class ListenerTest extends TestCase {
);
}
- public function testCommentEvent() {
+ public function testCommentEvent(): void {
$this->appManager->expects($this->any())
->method('isInstalled')
->with('activity')
diff --git a/apps/comments/tests/Unit/AppInfo/ApplicationTest.php b/apps/comments/tests/Unit/AppInfo/ApplicationTest.php
index c4e9bc7d45d..4b87982ab45 100644
--- a/apps/comments/tests/Unit/AppInfo/ApplicationTest.php
+++ b/apps/comments/tests/Unit/AppInfo/ApplicationTest.php
@@ -30,7 +30,7 @@ class ApplicationTest extends TestCase {
parent::tearDown();
}
- public function test() {
+ public function test(): void {
$app = new Application();
$c = $app->getContainer();
diff --git a/apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php b/apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php
index 334f24aec83..c0de0016c31 100644
--- a/apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php
+++ b/apps/comments/tests/Unit/Collaboration/CommentersSorterTest.php
@@ -28,7 +28,7 @@ class CommentersSorterTest extends TestCase {
* @dataProvider sortDataProvider
* @param $data
*/
- public function testSort($data) {
+ public function testSort($data): void {
$commentMocks = [];
foreach ($data['actors'] as $actorType => $actors) {
foreach ($actors as $actorId => $noOfComments) {
diff --git a/apps/comments/tests/Unit/Controller/NotificationsTest.php b/apps/comments/tests/Unit/Controller/NotificationsTest.php
index 03eba79e6c8..ccd808895c8 100644
--- a/apps/comments/tests/Unit/Controller/NotificationsTest.php
+++ b/apps/comments/tests/Unit/Controller/NotificationsTest.php
@@ -63,7 +63,7 @@ class NotificationsTest extends TestCase {
);
}
- public function testViewGuestRedirect() {
+ public function testViewGuestRedirect(): void {
$this->commentsManager->expects($this->never())
->method('get');
@@ -96,7 +96,7 @@ class NotificationsTest extends TestCase {
$this->assertSame('link-to-login', $response->getRedirectURL());
}
- public function testViewSuccess() {
+ public function testViewSuccess(): void {
$comment = $this->createMock(IComment::class);
$comment->expects($this->any())
->method('getObjectType')
@@ -146,7 +146,7 @@ class NotificationsTest extends TestCase {
$this->assertInstanceOf(RedirectResponse::class, $response);
}
- public function testViewInvalidComment() {
+ public function testViewInvalidComment(): void {
$this->commentsManager->expects($this->any())
->method('get')
->with('42')
@@ -174,7 +174,7 @@ class NotificationsTest extends TestCase {
$this->assertInstanceOf(NotFoundResponse::class, $response);
}
- public function testViewNoFile() {
+ public function testViewNoFile(): void {
$comment = $this->createMock(IComment::class);
$comment->expects($this->any())
->method('getObjectType')
diff --git a/apps/comments/tests/Unit/EventHandlerTest.php b/apps/comments/tests/Unit/EventHandlerTest.php
index 6459924ee8a..83ce1af57da 100644
--- a/apps/comments/tests/Unit/EventHandlerTest.php
+++ b/apps/comments/tests/Unit/EventHandlerTest.php
@@ -36,7 +36,7 @@ class EventHandlerTest extends TestCase {
$this->eventHandler = new CommentsEventListener($this->activityListener, $this->notificationListener);
}
- public function testNotFiles() {
+ public function testNotFiles(): void {
/** @var IComment|\PHPUnit\Framework\MockObject\MockObject $comment */
$comment = $this->getMockBuilder(IComment::class)->getMock();
$comment->expects($this->once())
@@ -69,7 +69,7 @@ class EventHandlerTest extends TestCase {
* @dataProvider handledProvider
* @param string $eventType
*/
- public function testHandled($eventType) {
+ public function testHandled($eventType): void {
/** @var IComment|\PHPUnit\Framework\MockObject\MockObject $comment */
$comment = $this->getMockBuilder(IComment::class)->getMock();
$comment->expects($this->once())
diff --git a/apps/comments/tests/Unit/Notification/ListenerTest.php b/apps/comments/tests/Unit/Notification/ListenerTest.php
index 3082333e8a3..4cdb5f93b15 100644
--- a/apps/comments/tests/Unit/Notification/ListenerTest.php
+++ b/apps/comments/tests/Unit/Notification/ListenerTest.php
@@ -55,7 +55,7 @@ class ListenerTest extends TestCase {
* @param string $eventType
* @param string $notificationMethod
*/
- public function testEvaluate($eventType, $notificationMethod) {
+ public function testEvaluate($eventType, $notificationMethod): void {
/** @var IComment|\PHPUnit\Framework\MockObject\MockObject $comment */
$comment = $this->getMockBuilder(IComment::class)->getMock();
$comment->expects($this->any())
@@ -123,7 +123,7 @@ class ListenerTest extends TestCase {
* @dataProvider eventProvider
* @param string $eventType
*/
- public function testEvaluateNoMentions($eventType) {
+ public function testEvaluateNoMentions($eventType): void {
/** @var IComment|\PHPUnit\Framework\MockObject\MockObject $comment */
$comment = $this->getMockBuilder(IComment::class)->getMock();
$comment->expects($this->any())
@@ -160,7 +160,7 @@ class ListenerTest extends TestCase {
$this->listener->evaluate($event);
}
- public function testEvaluateUserDoesNotExist() {
+ public function testEvaluateUserDoesNotExist(): void {
/** @var IComment|\PHPUnit\Framework\MockObject\MockObject $comment */
$comment = $this->getMockBuilder(IComment::class)->getMock();
$comment->expects($this->any())
diff --git a/apps/comments/tests/Unit/Notification/NotifierTest.php b/apps/comments/tests/Unit/Notification/NotifierTest.php
index a01c08a6760..87b87e646af 100644
--- a/apps/comments/tests/Unit/Notification/NotifierTest.php
+++ b/apps/comments/tests/Unit/Notification/NotifierTest.php
@@ -72,7 +72,7 @@ class NotifierTest extends TestCase {
$this->comment = $this->createMock(IComment::class);
}
- public function testPrepareSuccess() {
+ public function testPrepareSuccess(): void {
$fileName = 'Gre\'thor.odp';
$displayName = 'Huraga';
$message = '@Huraga mentioned you in a comment on "Gre\'thor.odp"';
@@ -190,7 +190,7 @@ class NotifierTest extends TestCase {
$this->notifier->prepare($this->notification, $this->lc);
}
- public function testPrepareSuccessDeletedUser() {
+ 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';
@@ -305,7 +305,7 @@ class NotifierTest extends TestCase {
}
- public function testPrepareDifferentApp() {
+ public function testPrepareDifferentApp(): void {
$this->expectException(UnknownNotificationException::class);
$this->folder
@@ -342,7 +342,7 @@ class NotifierTest extends TestCase {
}
- public function testPrepareNotFound() {
+ public function testPrepareNotFound(): void {
$this->expectException(UnknownNotificationException::class);
$this->folder
@@ -380,7 +380,7 @@ class NotifierTest extends TestCase {
}
- public function testPrepareDifferentSubject() {
+ public function testPrepareDifferentSubject(): void {
$this->expectException(UnknownNotificationException::class);
$displayName = 'Huraga';
@@ -437,7 +437,7 @@ class NotifierTest extends TestCase {
}
- public function testPrepareNotFiles() {
+ public function testPrepareNotFiles(): void {
$this->expectException(UnknownNotificationException::class);
$displayName = 'Huraga';
@@ -495,7 +495,7 @@ class NotifierTest extends TestCase {
}
- public function testPrepareUnresolvableFileID() {
+ public function testPrepareUnresolvableFileID(): void {
$this->expectException(AlreadyProcessedException::class);
$displayName = 'Huraga';