From 3d93ef9ceac12a32a19381a69077cefe227892d6 Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Sun, 21 Jul 2019 14:20:45 +0200 Subject: [PATCH] Fix tests (static usage for non-static methods) --- tests/src/Database/DBATest.php | 8 +++++--- tests/src/Database/DBStructureTest.php | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/src/Database/DBATest.php b/tests/src/Database/DBATest.php index 1ca5cd8bcf..69ea267bd2 100644 --- a/tests/src/Database/DBATest.php +++ b/tests/src/Database/DBATest.php @@ -15,10 +15,12 @@ class DBATest extends DatabaseTest public function setUp() { $configModel = new \Friendica\Model\Config\Config(self::$dba); - $config = Factory\ConfigFactory::createConfig(self::$configCache, $configModel); + $configFactory = new Factory\ConfigFactory(); + $config = $configFactory->createConfig(self::$configCache, $configModel); $pconfigModel = new \Friendica\Model\Config\PConfig(self::$dba); - Factory\ConfigFactory::createPConfig(self::$configCache, new PConfigCache(), $pconfigModel); - $logger = Factory\LoggerFactory::create('test', self::$dba, $config, self::$profiler); + $configFactory->createPConfig(self::$configCache, new PConfigCache(), $pconfigModel); + $loggerFactory = new Factory\LoggerFactory(); + $logger = $loggerFactory->create('test', self::$dba, $config, self::$profiler); $baseUrl = new BaseURL($config, $_SERVER); $router = new App\Router(); $l10n = new L10n($config, diff --git a/tests/src/Database/DBStructureTest.php b/tests/src/Database/DBStructureTest.php index ef777b30e8..a951d1c091 100644 --- a/tests/src/Database/DBStructureTest.php +++ b/tests/src/Database/DBStructureTest.php @@ -19,10 +19,12 @@ class DBStructureTest extends DatabaseTest public function setUp() { $configModel = new Config(self::$dba); - $config = Factory\ConfigFactory::createConfig(self::$configCache, $configModel); + $configFactory = new Factory\ConfigFactory(); + $config = $configFactory->createConfig(self::$configCache, $configModel); $pconfigModel = new \Friendica\Model\Config\PConfig(self::$dba); - Factory\ConfigFactory::createPConfig(self::$configCache, new PConfigCache(), $pconfigModel); - $logger = Factory\LoggerFactory::create('test', self::$dba, $config, self::$profiler); + $configFactory->createPConfig(self::$configCache, new PConfigCache(), $pconfigModel); + $loggerFactory = new Factory\LoggerFactory(); + $logger = $loggerFactory->create('test', self::$dba, $config, self::$profiler); $baseUrl = new BaseURL($config, $_SERVER); $router = new App\Router(); $l10n = new L10n($config,