Fix database lock driver test
This commit is contained in:
parent
14e7f12aa4
commit
2f13afb4c0
|
@ -23,6 +23,7 @@ namespace Friendica\Test\src\Core\Lock;
|
||||||
|
|
||||||
use Friendica\Core\Lock\Type\DatabaseLock;
|
use Friendica\Core\Lock\Type\DatabaseLock;
|
||||||
use Friendica\Core\Config\Factory\Config;
|
use Friendica\Core\Config\Factory\Config;
|
||||||
|
use Friendica\DI;
|
||||||
use Friendica\Test\DatabaseTestTrait;
|
use Friendica\Test\DatabaseTestTrait;
|
||||||
use Friendica\Test\Util\Database\StaticDatabase;
|
use Friendica\Test\Util\Database\StaticDatabase;
|
||||||
use Friendica\Test\Util\VFSTrait;
|
use Friendica\Test\Util\VFSTrait;
|
||||||
|
@ -48,20 +49,7 @@ class DatabaseLockDriverTest extends LockTest
|
||||||
|
|
||||||
protected function getInstance()
|
protected function getInstance()
|
||||||
{
|
{
|
||||||
$logger = new NullLogger();
|
return new DatabaseLock(DI::dba(), $this->pid);
|
||||||
$profiler = Mockery::mock(Profiler::class);
|
|
||||||
$profiler->shouldReceive('startRecording');
|
|
||||||
$profiler->shouldReceive('stopRecording');
|
|
||||||
$profiler->shouldReceive('saveTimestamp')->withAnyArgs()->andReturn(true);
|
|
||||||
|
|
||||||
// load real config to avoid mocking every config-entry which is related to the Database class
|
|
||||||
$configFactory = new Config();
|
|
||||||
$loader = (new Config())->createConfigFileLoader($this->root->url(), []);
|
|
||||||
$configCache = $configFactory->createCache($loader);
|
|
||||||
|
|
||||||
$dba = new StaticDatabase($configCache, $profiler, $logger);
|
|
||||||
|
|
||||||
return new DatabaseLock($dba, $this->pid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function tearDown(): void
|
protected function tearDown(): void
|
||||||
|
|
Loading…
Reference in New Issue
Block a user