[Pkg-owncloud-commits] [owncloud] 220/457: unit test for releaseall
David Prévot
taffit at moszumanska.debian.org
Sun Jun 28 20:06:10 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch stable8
in repository owncloud.
commit c72ea9f7d72d3ab22ff56195235808b17cecb0ba
Author: Robin Appelman <icewind at owncloud.com>
Date: Thu May 21 15:57:33 2015 +0200
unit test for releaseall
---
tests/lib/lock/lockingprovider.php | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/tests/lib/lock/lockingprovider.php b/tests/lib/lock/lockingprovider.php
index 08d879d..337aa4c 100644
--- a/tests/lib/lock/lockingprovider.php
+++ b/tests/lib/lock/lockingprovider.php
@@ -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
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list