25
25
use OCP \Files \Mount \IMountPoint ;
26
26
use OCP \Files \Mount \IShareOwnerlessMount ;
27
27
use OCP \Files \Node ;
28
- use OCP \Files \NotFoundException ;
29
28
use OCP \Files \Storage \IStorage ;
30
29
use OCP \HintException ;
31
30
use OCP \IAppConfig ;
@@ -675,24 +674,6 @@ public function testGetShareById(): void {
675
674
}
676
675
677
676
678
- public function testGetShareByIdNodeAccessible (): void {
679
- $ share = $ this ->createMock (IShare::class);
680
- $ share
681
- ->expects ($ this ->once ())
682
- ->method ('getNode ' )
683
- ->willThrowException (new NotFoundException ());
684
-
685
- $ this ->defaultProvider
686
- ->expects ($ this ->once ())
687
- ->method ('getShareById ' )
688
- ->with (42 )
689
- ->willReturn ($ share );
690
-
691
- $ this ->expectException (ShareNotFound::class);
692
- $ this ->manager ->getShareById ('default:42 ' );
693
- }
694
-
695
-
696
677
public function testGetExpiredShareById (): void {
697
678
$ this ->expectException (\OCP \Share \Exceptions \ShareNotFound::class);
698
679
@@ -2901,10 +2882,9 @@ public function testCreateShareOfIncomingFederatedShare(): void {
2901
2882
}
2902
2883
2903
2884
public function testGetSharesBy (): void {
2904
- $ node = $ this ->createMock (Folder::class);
2905
-
2906
2885
$ share = $ this ->manager ->newShare ();
2907
- $ share ->setNode ($ node );
2886
+
2887
+ $ node = $ this ->createMock (Folder::class);
2908
2888
2909
2889
$ this ->defaultProvider ->expects ($ this ->once ())
2910
2890
->method ('getSharesBy ' )
@@ -2957,8 +2937,6 @@ public function testGetSharesByOwnerless(): void {
2957
2937
* deleted (as they are evaluated). but share 8 should still be there.
2958
2938
*/
2959
2939
public function testGetSharesByExpiredLinkShares (): void {
2960
- $ node = $ this ->createMock (File::class);
2961
-
2962
2940
$ manager = $ this ->createManagerMock ()
2963
2941
->setMethods (['deleteShare ' ])
2964
2942
->getMock ();
@@ -2972,7 +2950,6 @@ public function testGetSharesByExpiredLinkShares(): void {
2972
2950
for ($ i = 0 ; $ i < 8 ; $ i ++) {
2973
2951
$ share = $ this ->manager ->newShare ();
2974
2952
$ share ->setId ($ i );
2975
- $ share ->setNode ($ node );
2976
2953
$ shares [] = $ share ;
2977
2954
}
2978
2955
@@ -2993,6 +2970,8 @@ public function testGetSharesByExpiredLinkShares(): void {
2993
2970
$ shares2 [] = clone $ shares [$ i ];
2994
2971
}
2995
2972
2973
+ $ node = $ this ->createMock (File::class);
2974
+
2996
2975
/*
2997
2976
* Simulate the getSharesBy call.
2998
2977
*/
@@ -3154,10 +3133,8 @@ public function testGetShareByTokenHideDisabledUser(): void {
3154
3133
$ date = new \DateTime ();
3155
3134
$ date ->setTime (0 , 0 , 0 );
3156
3135
$ date ->add (new \DateInterval ('P2D ' ));
3157
- $ node = $ this ->createMock (File::class);
3158
3136
$ share = $ this ->manager ->newShare ();
3159
3137
$ share ->setExpirationDate ($ date );
3160
- $ share ->setNode ($ node );
3161
3138
$ share ->setShareOwner ('owner ' );
3162
3139
$ share ->setSharedBy ('sharedBy ' );
3163
3140
@@ -3235,10 +3212,8 @@ public function testGetShareByTokenNotExpired(): void {
3235
3212
$ date = new \DateTime ();
3236
3213
$ date ->setTime (0 , 0 , 0 );
3237
3214
$ date ->add (new \DateInterval ('P2D ' ));
3238
- $ node = $ this ->createMock (Folder::class);
3239
3215
$ share = $ this ->manager ->newShare ();
3240
3216
$ share ->setExpirationDate ($ date );
3241
- $ share ->setNode ($ node );
3242
3217
3243
3218
$ this ->defaultProvider ->expects ($ this ->once ())
3244
3219
->method ('getShareByToken ' )
0 commit comments