File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 8
8
use OCA \FilesLock \AppInfo \Application ;
9
9
use OCA \FilesLock \Model \FileLock ;
10
10
use OCA \FilesLock \Service \ConfigService ;
11
+ use OCA \FilesLock \Service \LockService ;
11
12
use OCP \AppFramework \Utility \ITimeFactory ;
12
13
use OCP \Files \File ;
13
14
use OCP \Files \IRootFolder ;
@@ -204,6 +205,16 @@ public function testLockUserExpire() {
204
205
self ::assertEquals ('CCC ' , $ file ->getContent ());
205
206
}
206
207
208
+ public function testExpiredLocksAreDeprecated () {
209
+ \OCP \Server::get (IConfig::class)->setAppValue (Application::APP_ID , ConfigService::LOCK_TIMEOUT , 30 );
210
+ $ file = $ this ->loginAndGetUserFolder (self ::TEST_USER1 )
211
+ ->newFile ('test-expired-lock-is-deprecated ' , 'AAA ' );
212
+ $ this ->lockManager ->lock (new LockContext ($ file , ILock::TYPE_USER , self ::TEST_USER1 ));
213
+ $ this ->toTheFuture (3600 );
214
+ $ deprecated = \OCP \Server::get (LockService::class)->getDeprecatedLocks ();
215
+ self ::assertNotEmpty ($ deprecated );
216
+ }
217
+
207
218
public function testLockUserInfinite () {
208
219
\OCP \Server::get (IConfig::class)->setAppValue (Application::APP_ID , ConfigService::LOCK_TIMEOUT , 0 );
209
220
$ file = $ this ->loginAndGetUserFolder (self ::TEST_USER1 )
You can’t perform that action at this time.
0 commit comments