Skip to content
Snippets Groups Projects
Commit c72ea9f7 authored by Robin Appelman's avatar Robin Appelman
Browse files

unit test for releaseall

parent 6df502a5
No related branches found
No related tags found
No related merge requests found
......@@ -107,6 +107,30 @@ abstract class LockingProvider extends TestCase {
$this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_EXCLUSIVE));
}
public function testReleaseAll() {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
$this->instance->acquireLock('bar', ILockingProvider::LOCK_SHARED);
$this->instance->acquireLock('asd', ILockingProvider::LOCK_EXCLUSIVE);
$this->instance->releaseAll();
$this->assertFalse($this->instance->isLocked('foo', ILockingProvider::LOCK_SHARED));
$this->assertFalse($this->instance->isLocked('bar', ILockingProvider::LOCK_SHARED));
$this->assertFalse($this->instance->isLocked('asd', ILockingProvider::LOCK_EXCLUSIVE));
}
public function testReleaseAfterReleaseAll() {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
$this->instance->releaseAll();
$this->assertFalse($this->instance->isLocked('foo', ILockingProvider::LOCK_SHARED));
$this->instance->releaseLock('foo', ILockingProvider::LOCK_SHARED);
}
/**
* @expectedException \OCP\Lock\LockedException
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment