Beispiel #1
0
 /**
  * @expectedException \OCP\Files\LockNotAcquiredException
  */
 public function testDoubleLock()
 {
     $lock1 = $this->fileLock;
     $lock2 = new Lock(__DIR__ . '/data/test.txt');
     $lock1->addLock(Lock::WRITE);
     $lock2->addLock(Lock::WRITE);
 }
Beispiel #2
0
 public function testExistingHandleDontKeepLock()
 {
     // if the locked file handle goes out of scope, the lock needs to be cleaned up and we should be able to re-acquire a lock
     $this->lockExistingHandleAndOutOfScope();
     $lock = new Lock(__DIR__ . '/data/test.txt');
     $lock->addLock(Lock::WRITE);
     $this->assertTrue(true);
 }