namespace Friendica\Test\src\Core\Lock;
-
use Friendica\Core\Lock\SemaphoreLockDriver;
class SemaphoreLockDriverTest extends LockTest
{
- /**
- * @var \Friendica\Core\Lock\SemaphoreLockDriver
- */
- private $semaphoreLockDriver;
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->app->shouldReceive('getHostname')->andReturn('friendica.local');
+
+ $this->configMock
+ ->shouldReceive('get')
+ ->with('system', 'temppath')
+ ->andReturn('/tmp/');
+ }
protected function getInstance()
{
- $this->semaphoreLockDriver = new SemaphoreLockDriver();
- return $this->semaphoreLockDriver;
+ return new SemaphoreLockDriver();
}
- public function tearDown()
+ function testLockTTL()
{
- $this->semaphoreLockDriver->releaseAll();
- parent::tearDown();
+ // Semaphore doesn't work with TTL
+ return true;
}
}