コード例 #1
0
ファイル: LockTest.php プロジェクト: AdamWill/apps
 /**
  * @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);
 }
コード例 #2
0
ファイル: LockTest.php プロジェクト: Kevin-ZK/vaneDisk
 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);
 }