15
15
use OCA \DAV \Connector \Sabre \File ;
16
16
use OCA \DAV \Upload \FutureFile ;
17
17
use OCA \EndToEndEncryption \Connector \Sabre \LockPlugin ;
18
- use OCA \EndToEndEncryption \E2EEnabledPathCache ;
19
18
use OCA \EndToEndEncryption \LockManager ;
20
19
use OCA \EndToEndEncryption \UserAgentManager ;
21
20
use OCP \Files \Cache \ICache ;
31
30
32
31
class LockPluginTest extends TestCase {
33
32
34
- /** @var IRootFolder|\PHPUnit\Framework\MockObject\MockObject */
35
- private $ rootFolder ;
36
-
37
- /** @var IUserSession|\PHPUnit\Framework\MockObject\MockObject */
38
- private $ userSession ;
39
-
40
- /** @var LockManager|\PHPUnit\Framework\MockObject\MockObject */
41
- private $ lockManager ;
42
-
43
- /** @var UserAgentManager|\PHPUnit\Framework\MockObject\MockObject */
44
- private $ userAgentManager ;
45
-
46
- /** @var E2EEnabledPathCache|\PHPUnit\Framework\MockObject\MockObject */
47
- private $ pathCache ;
48
-
33
+ private IRootFolder &\PHPUnit \Framework \MockObject \MockObject $ rootFolder ;
34
+ private IUserSession &\PHPUnit \Framework \MockObject \MockObject $ userSession ;
35
+ private LockManager &\PHPUnit \Framework \MockObject \MockObject $ lockManager ;
36
+ private UserAgentManager &\PHPUnit \Framework \MockObject \MockObject $ userAgentManager ;
49
37
private LockPlugin $ plugin ;
50
38
51
39
protected function setUp (): void {
@@ -55,10 +43,8 @@ protected function setUp(): void {
55
43
$ this ->userSession = $ this ->createMock (IUserSession::class);
56
44
$ this ->lockManager = $ this ->createMock (LockManager::class);
57
45
$ this ->userAgentManager = $ this ->createMock (UserAgentManager::class);
58
- $ this ->pathCache = $ this ->createMock (E2EEnabledPathCache::class);
59
46
60
- $ this ->plugin = new LockPlugin ($ this ->rootFolder , $ this ->userSession ,
61
- $ this ->lockManager , $ this ->userAgentManager , $ this ->pathCache );
47
+ $ this ->plugin = new LockPlugin ($ this ->rootFolder , $ this ->userSession , $ this ->lockManager , $ this ->userAgentManager );
62
48
}
63
49
64
50
public function testInitialize (): void {
@@ -85,7 +71,6 @@ public function testCheckLockForCalendar(): void {
85
71
$ this ->userSession ,
86
72
$ this ->lockManager ,
87
73
$ this ->userAgentManager ,
88
- $ this ->pathCache ,
89
74
])
90
75
->getMock ();
91
76
@@ -132,7 +117,6 @@ public function testCheckLockNonCopyMoveNoE2EPath(string $method):void {
132
117
$ this ->userSession ,
133
118
$ this ->lockManager ,
134
119
$ this ->userAgentManager ,
135
- $ this ->pathCache ,
136
120
])
137
121
->getMock ();
138
122
@@ -183,7 +167,6 @@ public function testCheckLockBlockUnsupportedClients(string $method): void {
183
167
$ this ->userSession ,
184
168
$ this ->lockManager ,
185
169
$ this ->userAgentManager ,
186
- $ this ->pathCache ,
187
170
])
188
171
->getMock ();
189
172
@@ -267,7 +250,6 @@ public function testCheckLockForWrite(string $method,
267
250
$ this ->userSession ,
268
251
$ this ->lockManager ,
269
252
$ this ->userAgentManager ,
270
- $ this ->pathCache ,
271
253
])
272
254
->getMock ();
273
255
@@ -396,7 +378,6 @@ public function testCheckLockForWriteCopyMove(string $method,
396
378
$ this ->userSession ,
397
379
$ this ->lockManager ,
398
380
$ this ->userAgentManager ,
399
- $ this ->pathCache ,
400
381
])
401
382
->getMock ();
402
383
@@ -545,7 +526,6 @@ public function testIsE2EEnabledPathEncryptedFolder():void {
545
526
$ this ->userSession ,
546
527
$ this ->lockManager ,
547
528
$ this ->userAgentManager ,
548
- new E2EEnabledPathCache (),
549
529
])
550
530
->getMock ();
551
531
@@ -568,7 +548,6 @@ public function testIsE2EEnabledPathParentEncrypted():void {
568
548
$ this ->userSession ,
569
549
$ this ->lockManager ,
570
550
$ this ->userAgentManager ,
571
- new E2EEnabledPathCache (),
572
551
])
573
552
->getMock ();
574
553
@@ -624,7 +603,6 @@ public function testIsE2EEnabledPathNonEncrypted():void {
624
603
$ this ->userSession ,
625
604
$ this ->lockManager ,
626
605
$ this ->userAgentManager ,
627
- new E2EEnabledPathCache (),
628
606
])
629
607
->getMock ();
630
608
0 commit comments