@@ -184,15 +184,36 @@ public static function dataFileCreate(): array {
184184
185185 /**
186186 * @dataProvider dataFileCreate
187- *
188- * @param mixed $currentUser
189- * @param string $selfSubject
190- * @param string $othersSubject
191187 */
192- public function testFileCreate (string $ currentUser , string $ selfSubject , string $ othersSubject , string $ type ): void {
193- $ filesHooks = $ this ->getFilesHooks ([
194- 'addNotificationsForFileAction ' ,
195- ], $ currentUser );
188+ public function testFileCreate (string $ currentUser , bool $ isPublicShare , string $ selfSubject , string $ othersSubject , string $ type ): void {
189+ $ currentUserMock = $ this ->createMock (CurrentUser::class);
190+ $ currentUserMock ->method ('getUID ' )->willReturn ($ currentUser );
191+ $ currentUserMock ->method ('getUserIdentifier ' )->willReturn ($ currentUser );
192+ $ currentUserMock ->method ('isPublicShareToken ' )->willReturn ($ isPublicShare );
193+
194+ $ logger = $ this ->createMock (LoggerInterface::class);
195+
196+ $ filesHooks = $ this ->getMockBuilder (FilesHooks::class)
197+ ->setConstructorArgs ([
198+ $ this ->activityManager ,
199+ $ this ->data ,
200+ $ this ->settings ,
201+ $ this ->groupManager ,
202+ $ this ->view ,
203+ $ this ->rootFolder ,
204+ $ this ->shareHelper ,
205+ \OCP \Server::get (IDBConnection::class),
206+ $ this ->urlGenerator ,
207+ $ logger ,
208+ $ currentUserMock ,
209+ $ this ->userMountCache ,
210+ $ this ->config ,
211+ $ this ->notificationGenerator ,
212+ $ this ->tagManager ,
213+ $ this ->teamManager ,
214+ ])
215+ ->onlyMethods (['addNotificationsForFileAction ' ])
216+ ->getMock ();
196217
197218 $ filesHooks ->expects ($ this ->once ())
198219 ->method ('addNotificationsForFileAction ' )
0 commit comments