X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=tests%2Fsrc%2FCore%2FLock%2FLockTest.php;h=28f51733f428d9f7748dd0d52fa5a037a50bc047;hb=8660f6d86fc5d8f8f997b4b6a537b80d7ffbedff;hp=6dc170e51429bdfc659e8979b5e36cdc0e239d86;hpb=1df19d3553efc02c76ed17cdc617312f19b21bce;p=friendica.git diff --git a/tests/src/Core/Lock/LockTest.php b/tests/src/Core/Lock/LockTest.php index 6dc170e514..28f51733f4 100644 --- a/tests/src/Core/Lock/LockTest.php +++ b/tests/src/Core/Lock/LockTest.php @@ -87,7 +87,7 @@ abstract class LockTest extends MockedTest $this->assertTrue($this->instance->isLocked('bar')); $this->assertTrue($this->instance->isLocked('nice')); - $this->instance->releaseAll(); + $this->assertTrue($this->instance->releaseAll()); $this->assertFalse($this->instance->isLocked('foo')); $this->assertFalse($this->instance->isLocked('bar')); @@ -105,18 +105,30 @@ abstract class LockTest extends MockedTest $this->assertTrue($this->instance->acquireLock('bar', 1)); $this->assertTrue($this->instance->acquireLock('nice', 1)); - $this->instance->releaseLock('foo'); + $this->assertTrue($this->instance->releaseLock('foo')); $this->assertFalse($this->instance->isLocked('foo')); $this->assertTrue($this->instance->isLocked('bar')); $this->assertTrue($this->instance->isLocked('nice')); - $this->instance->releaseAll(); + $this->assertTrue($this->instance->releaseAll()); $this->assertFalse($this->instance->isLocked('bar')); $this->assertFalse($this->instance->isLocked('nice')); } + /** + * @small + */ + public function testReleaseWitTTL() + { + $this->assertFalse($this->instance->isLocked('test')); + $this->assertTrue($this->instance->acquireLock('test', 1, 10)); + $this->assertTrue($this->instance->isLocked('test')); + $this->assertTrue($this->instance->releaseLock('test')); + $this->assertFalse($this->instance->isLocked('test')); + } + /** * @medium */