diff options
Diffstat (limited to 'tests/lib/Lock/LockingProvider.php')
-rw-r--r-- | tests/lib/Lock/LockingProvider.php | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/tests/lib/Lock/LockingProvider.php b/tests/lib/Lock/LockingProvider.php index 75117657bf2..93eba367af2 100644 --- a/tests/lib/Lock/LockingProvider.php +++ b/tests/lib/Lock/LockingProvider.php @@ -73,10 +73,10 @@ abstract class LockingProvider extends TestCase { $this->assertFalse($this->instance->isLocked('foo', ILockingProvider::LOCK_SHARED)); } - /** - * @expectedException \OCP\Lock\LockedException - */ + public function testDoubleExclusiveLock() { + $this->expectException(\OCP\Lock\LockedException::class); + $this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE); $this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_EXCLUSIVE)); $this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE); @@ -90,10 +90,10 @@ abstract class LockingProvider extends TestCase { $this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE); } - /** - * @expectedException \OCP\Lock\LockedException - */ + public function testExclusiveLockAfterShared() { + $this->expectException(\OCP\Lock\LockedException::class); + $this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED); $this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_SHARED)); $this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE); @@ -164,10 +164,10 @@ abstract class LockingProvider extends TestCase { } - /** - * @expectedException \OCP\Lock\LockedException - */ + public function testSharedLockAfterExclusive() { + $this->expectException(\OCP\Lock\LockedException::class); + $this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE); $this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_EXCLUSIVE)); $this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED); @@ -211,41 +211,41 @@ abstract class LockingProvider extends TestCase { $this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_SHARED)); } - /** - * @expectedException \OCP\Lock\LockedException - */ + public function testChangeLockToExclusiveDoubleShared() { + $this->expectException(\OCP\Lock\LockedException::class); + $this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED); $this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED); $this->instance->changeLock('foo', ILockingProvider::LOCK_EXCLUSIVE); } - /** - * @expectedException \OCP\Lock\LockedException - */ + public function testChangeLockToExclusiveNoShared() { + $this->expectException(\OCP\Lock\LockedException::class); + $this->instance->changeLock('foo', ILockingProvider::LOCK_EXCLUSIVE); } - /** - * @expectedException \OCP\Lock\LockedException - */ + public function testChangeLockToExclusiveFromExclusive() { + $this->expectException(\OCP\Lock\LockedException::class); + $this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE); $this->instance->changeLock('foo', ILockingProvider::LOCK_EXCLUSIVE); } - /** - * @expectedException \OCP\Lock\LockedException - */ + public function testChangeLockToSharedNoExclusive() { + $this->expectException(\OCP\Lock\LockedException::class); + $this->instance->changeLock('foo', ILockingProvider::LOCK_SHARED); } - /** - * @expectedException \OCP\Lock\LockedException - */ + public function testChangeLockToSharedFromShared() { + $this->expectException(\OCP\Lock\LockedException::class); + $this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED); $this->instance->changeLock('foo', ILockingProvider::LOCK_SHARED); } |