Replace Config-Cache dependency with Config-Model (no more DB-waiting necessary)

This commit is contained in:
Philipp 2023-01-15 16:12:25 +01:00
parent a6fb683bcd
commit ab6efea9b2
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
18 changed files with 210 additions and 325 deletions

View file

@ -25,6 +25,7 @@ use Dice\Dice;
use Friendica\App;
use Friendica\Core\Cache\Capability\ICanCache;
use Friendica\Core\Cache\Capability\ICanCacheInMemory;
use Friendica\Core\Config\Model\Config;
use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Lock\Capability\ICanLock;
@ -86,33 +87,6 @@ class DependencyCheckTest extends TestCase
self::assertArrayHasKey('system', $configCache->getAll());
}
/**
* Test the construction of a profiler class with DI
*/
public function testProfiler()
{
/** @var Profiler $profiler */
$profiler = $this->dice->create(Profiler::class);
self::assertInstanceOf(Profiler::class, $profiler);
$configCache = new Cache([
'system' => [
'profiler' => true,
],
'rendertime' => [
'callstack' => true,
]
]);
// create new DI-library because of shared instance rule (so the Profiler wouldn't get created twice)
$this->dice = new Dice();
$profiler = $this->dice->create(Profiler::class, [$configCache]);
self::assertInstanceOf(Profiler::class, $profiler);
self::assertTrue($profiler->isRendertime());
}
public function testDatabase()
{
// PDO needs to be disabled for PHP 7.2, see https://jira.mariadb.org/browse/MDEV-24121