From ec14d95292c42ce84320cadcd1b6cf8f5d543131 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Sat, 23 Nov 2019 13:13:54 +0100 Subject: [PATCH] Fix lockprivider test Signed-off-by: Roeland Jago Douma --- tests/lib/Lock/LockingProvider.php | 10 ++++++++-- 1 file 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());