Fix lockprivider test

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2019-11-23 13:13:54 +01:00
parent 8d4346d656
commit ec14d95292
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 8 additions and 2 deletions

View File

@ -175,7 +175,10 @@ abstract class LockingProvider extends TestCase {
public function testLockedExceptionHasPathForShared() { public function testLockedExceptionHasPathForShared() {
try { 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'); $this->fail('Expected locked exception');
} catch (LockedException $e) { } catch (LockedException $e) {
$this->assertEquals('foo', $e->getPath()); $this->assertEquals('foo', $e->getPath());
@ -184,7 +187,10 @@ abstract class LockingProvider extends TestCase {
public function testLockedExceptionHasPathForExclusive() { public function testLockedExceptionHasPathForExclusive() {
try { 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'); $this->fail('Expected locked exception');
} catch (LockedException $e) { } catch (LockedException $e) {
$this->assertEquals('foo', $e->getPath()); $this->assertEquals('foo', $e->getPath());