code standards / simplifications
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Friendica\Test\src\Core\Lock;
|
||||
namespace Friendica\Test\Core\Lock;
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\Config;
|
||||
@@ -34,29 +34,29 @@ abstract class LockTest extends TestCase
|
||||
}
|
||||
|
||||
public function testLock() {
|
||||
$this->instance->acquireLock('foo', 1);
|
||||
$this->instance->acquire('foo', 1);
|
||||
$this->assertTrue($this->instance->isLocked('foo'));
|
||||
$this->assertFalse($this->instance->isLocked('bar'));
|
||||
}
|
||||
|
||||
public function testDoubleLock() {
|
||||
$this->instance->acquireLock('foo', 1);
|
||||
$this->instance->acquire('foo', 1);
|
||||
$this->assertTrue($this->instance->isLocked('foo'));
|
||||
// We already locked it
|
||||
$this->assertTrue($this->instance->acquireLock('foo', 1));
|
||||
$this->assertTrue($this->instance->acquire('foo', 1));
|
||||
}
|
||||
|
||||
public function testReleaseLock() {
|
||||
$this->instance->acquireLock('foo', 1);
|
||||
$this->instance->acquire('foo', 1);
|
||||
$this->assertTrue($this->instance->isLocked('foo'));
|
||||
$this->instance->releaseLock('foo');
|
||||
$this->instance->release('foo');
|
||||
$this->assertFalse($this->instance->isLocked('foo'));
|
||||
}
|
||||
|
||||
public function testReleaseAll() {
|
||||
$this->instance->acquireLock('foo', 1);
|
||||
$this->instance->acquireLock('bar', 1);
|
||||
$this->instance->acquireLock('#/$%§', 1);
|
||||
$this->instance->acquire('foo', 1);
|
||||
$this->instance->acquire('bar', 1);
|
||||
$this->instance->acquire('#/$%§', 1);
|
||||
|
||||
$this->instance->releaseAll();
|
||||
|
||||
@@ -66,11 +66,11 @@ abstract class LockTest extends TestCase
|
||||
}
|
||||
|
||||
public function testReleaseAfterUnlock() {
|
||||
$this->instance->acquireLock('foo', 1);
|
||||
$this->instance->acquireLock('bar', 1);
|
||||
$this->instance->acquireLock('#/$%§', 1);
|
||||
$this->instance->acquire('foo', 1);
|
||||
$this->instance->acquire('bar', 1);
|
||||
$this->instance->acquire('#/$%§', 1);
|
||||
|
||||
$this->instance->releaseLock('foo');
|
||||
$this->instance->release('foo');
|
||||
|
||||
$this->instance->releaseAll();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user