@@ -5011,20 +5011,19 @@ function ($user) {
50115011 ->with ('files_sharing.sharecontroller.showShare ' , ['token ' => 'myToken ' ])
50125012 ->willReturn ('myLink ' );
50135013
5014- $ this ->rootFolder ->method ('getUserFolder ' )
5015- ->with ($ this ->currentUser )
5016- ->willReturnSelf ();
5017- $ this ->dateTimeZone ->method ('getTimezone ' )->willReturn (new \DateTimeZone ('UTC ' ));
5018-
5014+ $ userFolder = $ this ->createMock (IUserFolder::class);
50195015 if (!$ exception ) {
5020- $ this -> rootFolder ->method ('getFirstNodeById ' )
5016+ $ userFolder ->method ('getFirstNodeById ' )
50215017 ->with ($ share ->getNodeId ())
50225018 ->willReturn ($ share ->getNode ());
50235019
5024- $ this -> rootFolder ->method ('getRelativePath ' )
5020+ $ userFolder ->method ('getRelativePath ' )
50255021 ->with ($ share ->getNode ()->getPath ())
50265022 ->willReturnArgument (0 );
50275023 }
5024+ $ this ->rootFolder ->method ('getUserFolder ' )->with ($ this ->currentUser )->willReturn ($ userFolder );
5025+ $ this ->dateTimeZone ->method ('getTimezone ' )->willReturn (new \DateTimeZone ('UTC ' ));
5026+
50285027
50295028 $ cm = $ this ->createMock (\OCP \Contacts \IManager::class);
50305029 $ this ->overwriteService (\OCP \Contacts \IManager::class, $ cm );
@@ -5204,17 +5203,14 @@ public function testFormatRoomShare(array $expects, bool $helperAvailable, array
52045203 ->setNote ('personal note ' )
52055204 ->setId (42 );
52065205
5207- $ this ->rootFolder ->method ('getUserFolder ' )
5208- ->with ($ this ->currentUser )
5209- ->willReturnSelf ();
5210-
5211- $ this ->rootFolder ->method ('getFirstNodeById ' )
5206+ $ userFolder = $ this ->createMock (IUserFolder::class);
5207+ $ userFolder ->method ('getFirstNodeById ' )
52125208 ->with ($ share ->getNodeId ())
52135209 ->willReturn ($ share ->getNode ());
5214-
5215- $ this ->rootFolder ->method ('getRelativePath ' )
5210+ $ userFolder ->method ('getRelativePath ' )
52165211 ->with ($ share ->getNode ()->getPath ())
52175212 ->willReturnArgument (0 );
5213+ $ this ->rootFolder ->method ('getUserFolder ' )->with ($ this ->currentUser )->willReturn ($ userFolder );
52185214
52195215 if (!$ helperAvailable ) {
52205216 $ this ->appManager ->method ('isEnabledForUser ' )
@@ -5361,17 +5357,14 @@ public function testFormatShareWithFederatedShare(bool $isKnownServer, bool $isT
53615357
53625358 $ this ->previewManager ->method ('isAvailable ' )->with ($ node )->willReturn (false );
53635359
5364- $ this ->rootFolder ->method ('getUserFolder ' )
5365- ->with ($ this ->currentUser )
5366- ->willReturnSelf ();
5367-
5368- $ this ->rootFolder ->method ('getFirstNodeById ' )
5360+ $ userFolder = $ this ->createMock (IUserFolder::class);
5361+ $ userFolder ->method ('getFirstNodeById ' )
53695362 ->with ($ share ->getNodeId ())
53705363 ->willReturn ($ node );
5371-
5372- $ this ->rootFolder ->method ('getRelativePath ' )
5364+ $ userFolder ->method ('getRelativePath ' )
53735365 ->with ($ node ->getPath ())
53745366 ->willReturnArgument (0 );
5367+ $ this ->rootFolder ->method ('getUserFolder ' )->with ($ this ->currentUser )->willReturn ($ userFolder );
53755368
53765369 $ serverName = 'remoteserver.com ' ;
53775370 $ this ->trustedServers ->method ('isTrustedServer ' )
@@ -5424,17 +5417,14 @@ public function testFormatShareWithFederatedShareWithAtInUsername(): void {
54245417
54255418 $ this ->previewManager ->method ('isAvailable ' )->with ($ node )->willReturn (false );
54265419
5427- $ this ->rootFolder ->method ('getUserFolder ' )
5428- ->with ($ this ->currentUser )
5429- ->willReturnSelf ();
5430-
5431- $ this ->rootFolder ->method ('getFirstNodeById ' )
5420+ $ userFolder = $ this ->createMock (IUserFolder::class);
5421+ $ userFolder ->method ('getFirstNodeById ' )
54325422 ->with ($ share ->getNodeId ())
54335423 ->willReturn ($ node );
5434-
5435- $ this ->rootFolder ->method ('getRelativePath ' )
5424+ $ userFolder ->method ('getRelativePath ' )
54365425 ->with ($ node ->getPath ())
54375426 ->willReturnArgument (0 );
5427+ $ this ->rootFolder ->method ('getUserFolder ' )->with ($ this ->currentUser )->willReturn ($ userFolder );
54385428
54395429 $ serverName = 'remoteserver.com ' ;
54405430 $ this ->trustedServers ->method ('isTrustedServer ' )
0 commit comments