2929use OCA \Deck \Db \CardMapper ;
3030use OCA \Deck \Db \ChangeHelper ;
3131use OCA \Deck \Notification \NotificationHelper ;
32- use OCP \Comments \CommentsEvent ;
32+ use OCP \Comments \Events \CommentAddedEvent ;
33+ use OCP \Comments \Events \CommentUpdatedEvent ;
3334use OCP \Comments \IComment ;
3435use PHPUnit \Framework \TestCase ;
3536
@@ -68,7 +69,7 @@ public function testHandle() {
6869 $ this ->cardMapper ->expects ($ this ->once ())
6970 ->method ('find ' )
7071 ->willReturn ($ card );
71- $ commentsEvent = new CommentsEvent (CommentsEvent:: EVENT_ADD , $ comment );
72+ $ commentsEvent = new CommentAddedEvent ( $ comment );
7273 $ this ->activityManager ->expects ($ this ->once ())
7374 ->method ('triggerEvent ' )
7475 ->with (ActivityManager::DECK_OBJECT_CARD , $ card , ActivityManager::SUBJECT_CARD_COMMENT_CREATE , ['comment ' => $ comment ]);
@@ -82,7 +83,7 @@ public function testHandleUpdate() {
8283 $ comment = $ this ->createMock (IComment::class);
8384 $ comment ->expects ($ this ->any ())->method ('getId ' )->willReturn (1 );
8485 $ comment ->expects ($ this ->any ())->method ('getObjectType ' )->willReturn ('deckCard ' );
85- $ commentsEvent = new CommentsEvent (CommentsEvent:: EVENT_UPDATE , $ comment );
86+ $ commentsEvent = new CommentUpdatedEvent ( $ comment );
8687 $ this ->activityManager ->expects ($ this ->never ())
8788 ->method ('triggerEvent ' );
8889 $ this ->notificationHelper ->expects ($ this ->once ())
@@ -95,7 +96,7 @@ public function testHandleInvalid() {
9596 $ comment = $ this ->createMock (IComment::class);
9697 $ comment ->expects ($ this ->any ())->method ('getId ' )->willReturn (1 );
9798 $ comment ->expects ($ this ->any ())->method ('getObjectType ' )->willReturn ('other ' );
98- $ commentsEvent = new CommentsEvent (CommentsEvent:: EVENT_ADD , $ comment );
99+ $ commentsEvent = new CommentAddedEvent ( $ comment );
99100 $ this ->activityManager ->expects ($ this ->never ())
100101 ->method ('triggerEvent ' );
101102 $ this ->commentEventHandler ->handle ($ commentsEvent );
0 commit comments