@@ -53,9 +53,7 @@ protected function setUp(): void
5353
5454 // Create mock current user
5555 $ this ->currentUser = $ this ->createMock (CurrentUser::class);
56- $ this ->currentUser
57- ->method ('getUserId ' )
58- ->willReturn (1 );
56+ $ this ->currentUser ->method ('getUserId ' )->willReturn (1 );
5957
6058 $ this ->currentGroups = [1 ];
6159
@@ -142,9 +140,7 @@ public function testCanUserAddFaqForGuest(): void
142140 {
143141 // Mock guest user (user ID = -1)
144142 $ guestUser = $ this ->createMock (CurrentUser::class);
145- $ guestUser
146- ->method ('getUserId ' )
147- ->willReturn (-1 );
143+ $ guestUser ->method ('getUserId ' )->willReturn (-1 );
148144
149145 $ service = new FaqCreationService ($ this ->configuration , $ guestUser , $ this ->currentGroups );
150146
@@ -161,9 +157,7 @@ public function testCanUserAddFaqForGuestWhenDisabled(): void
161157
162158 // Mock guest user (user ID = -1)
163159 $ guestUser = $ this ->createMock (CurrentUser::class);
164- $ guestUser
165- ->method ('getUserId ' )
166- ->willReturn (-1 );
160+ $ guestUser ->method ('getUserId ' )->willReturn (-1 );
167161
168162 $ service = new FaqCreationService ($ this ->configuration , $ guestUser , $ this ->currentGroups );
169163
@@ -177,9 +171,7 @@ public function testCanUserAddFaqForLoggedInUserWithPermission(): void
177171 {
178172 // Create a user mock with permission
179173 $ userWithPerm = $ this ->createMock (CurrentUser::class);
180- $ userWithPerm
181- ->method ('getUserId ' )
182- ->willReturn (1 );
174+ $ userWithPerm ->method ('getUserId ' )->willReturn (1 );
183175
184176 $ permMock = $ this ->createMock (\phpMyFAQ \Permission \PermissionInterface::class);
185177 $ permMock
@@ -202,9 +194,7 @@ public function testCanUserAddFaqForLoggedInUserWithoutPermission(): void
202194 {
203195 // Create a user mock without permission
204196 $ userWithoutPerm = $ this ->createMock (CurrentUser::class);
205- $ userWithoutPerm
206- ->method ('getUserId ' )
207- ->willReturn (1 );
197+ $ userWithoutPerm ->method ('getUserId ' )->willReturn (1 );
208198
209199 $ permMock = $ this ->createMock (\phpMyFAQ \Permission \PermissionInterface::class);
210200 $ permMock
@@ -241,9 +231,7 @@ public function testGetDefaultUserEmailForLoggedInUser(): void
241231 public function testGetDefaultUserEmailForGuest (): void
242232 {
243233 $ guestUser = $ this ->createMock (CurrentUser::class);
244- $ guestUser
245- ->method ('getUserId ' )
246- ->willReturn (-1 );
234+ $ guestUser ->method ('getUserId ' )->willReturn (-1 );
247235
248236 $ service = new FaqCreationService ($ this ->configuration , $ guestUser , $ this ->currentGroups );
249237
@@ -273,9 +261,7 @@ public function testGetDefaultUserNameForLoggedInUser(): void
273261 public function testGetDefaultUserNameForGuest (): void
274262 {
275263 $ guestUser = $ this ->createMock (CurrentUser::class);
276- $ guestUser
277- ->method ('getUserId ' )
278- ->willReturn (-1 );
264+ $ guestUser ->method ('getUserId ' )->willReturn (-1 );
279265
280266 $ service = new FaqCreationService ($ this ->configuration , $ guestUser , $ this ->currentGroups );
281267
@@ -335,14 +321,10 @@ public function testCanUserAddFaqReturnsBooleanValue(): void
335321 {
336322 // Create a user mock with permission
337323 $ userWithPerm = $ this ->createMock (CurrentUser::class);
338- $ userWithPerm
339- ->method ('getUserId ' )
340- ->willReturn (1 );
324+ $ userWithPerm ->method ('getUserId ' )->willReturn (1 );
341325
342326 $ permMock = $ this ->createMock (\phpMyFAQ \Permission \PermissionInterface::class);
343- $ permMock
344- ->method ('hasPermission ' )
345- ->willReturn (true );
327+ $ permMock ->method ('hasPermission ' )->willReturn (true );
346328
347329 $ userWithPerm ->perm = $ permMock ;
348330
@@ -359,13 +341,8 @@ public function testCanUserAddFaqReturnsBooleanValue(): void
359341 public function testGetDefaultUserEmailReturnsString (): void
360342 {
361343 $ userMock = $ this ->createMock (CurrentUser::class);
362- $ userMock
363- ->method ('getUserId ' )
364- ->willReturn (1 );
365- $ userMock
366- ->method ('getUserData ' )
367- ->with ('email ' )
368- ->
willReturn (
'[email protected] ' );
344+ $ userMock ->method ('getUserId ' )->willReturn (1 );
345+ $ userMock->
method (
'getUserData ' )->
with (
'email ' )->
willReturn (
'[email protected] ' );
369346
370347 $ service = new FaqCreationService ($ this ->configuration , $ userMock , $ this ->currentGroups );
371348
@@ -380,13 +357,8 @@ public function testGetDefaultUserEmailReturnsString(): void
380357 public function testGetDefaultUserNameReturnsString (): void
381358 {
382359 $ userMock = $ this ->createMock (CurrentUser::class);
383- $ userMock
384- ->method ('getUserId ' )
385- ->willReturn (1 );
386- $ userMock
387- ->method ('getUserData ' )
388- ->with ('display_name ' )
389- ->willReturn ('John Doe ' );
360+ $ userMock ->method ('getUserId ' )->willReturn (1 );
361+ $ userMock ->method ('getUserData ' )->with ('display_name ' )->willReturn ('John Doe ' );
390362
391363 $ service = new FaqCreationService ($ this ->configuration , $ userMock , $ this ->currentGroups );
392364
0 commit comments