aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Lock
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-11-23 13:13:54 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-11-27 13:34:42 +0100
commitec14d95292c42ce84320cadcd1b6cf8f5d543131 (patch)
tree96efab85d8c3a32b8d86d20f9ff7efc1921ba05d /tests/lib/Lock
parent8d4346d65688d2aabd6e144fe3f3609897a46230 (diff)
downloadnextcloud-server-ec14d95292c42ce84320cadcd1b6cf8f5d543131.tar.gz
nextcloud-server-ec14d95292c42ce84320cadcd1b6cf8f5d543131.zip
Fix lockprivider test
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests/lib/Lock')
-rw-r--r--tests/lib/Lock/LockingProvider.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/lib/Lock/LockingProvider.php b/tests/lib/Lock/LockingProvider.php
index 7faca3ea90c..75117657bf2 100644
--- a/tests/lib/Lock/LockingProvider.php
+++ b/tests/lib/Lock/LockingProvider.php
@@ -175,7 +175,10 @@ abstract class LockingProvider extends TestCase {
public function testLockedExceptionHasPathForShared() {
try {
- $this->testSharedLockAfterExclusive();
+ $this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE);
+ $this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_EXCLUSIVE));
+ $this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
+
$this->fail('Expected locked exception');
} catch (LockedException $e) {
$this->assertEquals('foo', $e->getPath());
@@ -184,7 +187,10 @@ abstract class LockingProvider extends TestCase {
public function testLockedExceptionHasPathForExclusive() {
try {
- $this->testExclusiveLockAfterShared();
+ $this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE);
+ $this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_EXCLUSIVE));
+ $this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
+
$this->fail('Expected locked exception');
} catch (LockedException $e) {
$this->assertEquals('foo', $e->getPath());