@@ -55,7 +55,7 @@ public static function davPermissionsProvider(): array {
5555 public function testDavPermissions (int $ permissions , string $ type , bool $ shared , int $ shareRootPermissions , bool $ mounted , string $ internalPath , string $ expected ): void {
5656 $ info = $ this ->getMockBuilder (FileInfo::class)
5757 ->disableOriginalConstructor ()
58- ->onlyMethods (['getPermissions ' , 'isShared ' , 'isMounted ' , 'getType ' , 'getInternalPath ' , 'getStorage ' , 'getMountPoint ' ])
58+ ->onlyMethods (['getPermissions ' , 'isShared ' , 'isMounted ' , 'getType ' , 'getInternalPath ' , 'getStorage ' , 'getMountPoint ' , ' getPath ' ])
5959 ->getMock ();
6060 $ info ->method ('getPermissions ' )
6161 ->willReturn ($ permissions );
@@ -65,6 +65,8 @@ public function testDavPermissions(int $permissions, string $type, bool $shared,
6565 ->willReturn ($ mounted );
6666 $ info ->method ('getType ' )
6767 ->willReturn ($ type );
68+ $ info ->method ('getPath ' )
69+ ->willReturn ('' );
6870 $ info ->method ('getInternalPath ' )
6971 ->willReturn ($ internalPath );
7072 $ info ->method ('getMountPoint ' )
@@ -160,18 +162,18 @@ public function testSharePermissions(string $type, ?string $user, int $permissio
160162
161163 $ info = $ this ->getMockBuilder (FileInfo::class)
162164 ->disableOriginalConstructor ()
163- ->onlyMethods (['getStorage ' , 'getType ' , 'getMountPoint ' , 'getPermissions ' ])
165+ ->onlyMethods (['getStorage ' , 'getType ' , 'getMountPoint ' , 'getPermissions ' , ' getPath ' ])
164166 ->getMock ();
165167
166168 $ info ->method ('getStorage ' )->willReturn ($ storage );
169+ $ info ->method ('getPath ' )->willReturn ('notMyPath ' );
167170 $ info ->method ('getType ' )->willReturn ($ type );
168171 $ info ->method ('getMountPoint ' )->willReturn ($ mountpoint );
169172 $ info ->method ('getPermissions ' )->willReturn ($ permissions );
170173
171174 $ view = $ this ->createMock (View::class);
172175
173- $ node = new File ($ view , $ info );
174- $ this ->invokePrivate ($ node , 'shareManager ' , [$ shareManager ]);
176+ $ node = new File ($ view , $ info , $ shareManager );
175177 $ this ->assertEquals ($ expected , $ node ->getSharePermissions ($ user ));
176178 }
177179
@@ -196,9 +198,10 @@ public function testShareAttributes(): void {
196198 /** @var Folder&MockObject $info */
197199 $ info = $ this ->getMockBuilder (Folder::class)
198200 ->disableOriginalConstructor ()
199- ->onlyMethods (['getStorage ' , 'getType ' ])
201+ ->onlyMethods (['getStorage ' , 'getType ' , ' getPath ' ])
200202 ->getMock ();
201203
204+ $ info ->method ('getPath ' )->willReturn ('myPath ' );
202205 $ info ->method ('getStorage ' )->willReturn ($ storage );
203206 $ info ->method ('getType ' )->willReturn (FileInfo::TYPE_FOLDER );
204207
@@ -217,9 +220,10 @@ public function testShareAttributesNonShare(): void {
217220 /** @var Folder&MockObject */
218221 $ info = $ this ->getMockBuilder (Folder::class)
219222 ->disableOriginalConstructor ()
220- ->onlyMethods (['getStorage ' , 'getType ' ])
223+ ->onlyMethods (['getStorage ' , 'getType ' , ' getPath ' ])
221224 ->getMock ();
222225
226+ $ info ->method ('getPath ' )->willReturn ('myPath ' );
223227 $ info ->method ('getStorage ' )->willReturn ($ storage );
224228 $ info ->method ('getType ' )->willReturn (FileInfo::TYPE_FOLDER );
225229
0 commit comments