2018-07-04 23:37:22 +02:00
|
|
|
<?php
|
|
|
|
|
2018-07-05 20:57:31 +02:00
|
|
|
namespace Friendica\Test\src\Core\Lock;
|
2018-07-04 23:37:22 +02:00
|
|
|
|
|
|
|
use Friendica\Core\Lock\SemaphoreLockDriver;
|
|
|
|
|
|
|
|
class SemaphoreLockDriverTest extends LockTest
|
|
|
|
{
|
2019-01-30 20:26:17 +01:00
|
|
|
public function setUp()
|
|
|
|
{
|
|
|
|
parent::setUp();
|
|
|
|
|
|
|
|
$this->app->shouldReceive('getHostname')->andReturn('friendica.local');
|
2019-02-07 20:44:03 +01:00
|
|
|
|
|
|
|
$this->configCache
|
|
|
|
->shouldReceive('get')
|
2019-02-10 19:52:21 +01:00
|
|
|
->with('system', 'temppath', NULL, false)
|
2019-02-07 20:44:03 +01:00
|
|
|
->andReturn('/tmp/');
|
2019-01-30 20:26:17 +01:00
|
|
|
}
|
|
|
|
|
2018-07-04 23:37:22 +02:00
|
|
|
protected function getInstance()
|
|
|
|
{
|
2018-09-05 22:16:23 +02:00
|
|
|
return new SemaphoreLockDriver();
|
2018-07-04 23:37:22 +02:00
|
|
|
}
|
2018-07-07 19:46:16 +02:00
|
|
|
|
|
|
|
function testLockTTL()
|
|
|
|
{
|
|
|
|
// Semaphore doesn't work with TTL
|
|
|
|
return true;
|
|
|
|
}
|
2018-07-07 16:15:03 +02:00
|
|
|
}
|