mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-11 07:14:27 +02:00
Split Storage usage and Storage configuration
This commit is contained in:
parent
ac9e5df614
commit
065b46c721
12 changed files with 379 additions and 208 deletions
|
@ -23,11 +23,9 @@ namespace Friendica\Test\src\Model\Storage;
|
|||
|
||||
use Friendica\Factory\ConfigFactory;
|
||||
use Friendica\Model\Storage\Database;
|
||||
use Friendica\Model\Storage\IWritableStorage;
|
||||
use Friendica\Test\DatabaseTestTrait;
|
||||
use Friendica\Test\Util\Database\StaticDatabase;
|
||||
use Friendica\Test\Util\VFSTrait;
|
||||
use Friendica\Util\ConfigFileLoader;
|
||||
use Friendica\Util\Profiler;
|
||||
use Psr\Log\NullLogger;
|
||||
|
||||
|
@ -47,7 +45,7 @@ class DatabaseStorageTest extends StorageTest
|
|||
|
||||
protected function getInstance()
|
||||
{
|
||||
$logger = new NullLogger();
|
||||
$logger = new NullLogger();
|
||||
$profiler = \Mockery::mock(Profiler::class);
|
||||
$profiler->shouldReceive('startRecording');
|
||||
$profiler->shouldReceive('stopRecording');
|
||||
|
@ -55,19 +53,14 @@ class DatabaseStorageTest extends StorageTest
|
|||
|
||||
// load real config to avoid mocking every config-entry which is related to the Database class
|
||||
$configFactory = new ConfigFactory();
|
||||
$loader = (new ConfigFactory())->createConfigFileLoader($this->root->url(), []);
|
||||
$configCache = $configFactory->createCache($loader);
|
||||
$loader = (new ConfigFactory())->createConfigFileLoader($this->root->url(), []);
|
||||
$configCache = $configFactory->createCache($loader);
|
||||
|
||||
$dba = new StaticDatabase($configCache, $profiler, $logger);
|
||||
|
||||
return new Database($dba);
|
||||
}
|
||||
|
||||
protected function assertOption(IWritableStorage $storage)
|
||||
{
|
||||
self::assertEmpty($storage->getOptions());
|
||||
}
|
||||
|
||||
protected function tearDown(): void
|
||||
{
|
||||
$this->tearDownDb();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue