]> git.mxchange.org Git - friendica.git/blobdiff - tests/functional/DependencyCheckTest.php
Merge pull request #8053 from nupplaphil/task/remove_get_app
[friendica.git] / tests / functional / DependencyCheckTest.php
index bc8d256a78f821c3f4c98ba182c0102ba50d33f4..4e05845f29cb3de682171e3916e4cb78b638af2d 100644 (file)
@@ -7,7 +7,7 @@ use Friendica\App;
 use Friendica\Core\Cache\ICache;
 use Friendica\Core\Cache\IMemoryCache;
 use Friendica\Core\Config\Cache\ConfigCache;
-use Friendica\Core\Config\Configuration;
+use Friendica\Core\Config\IConfiguration;
 use Friendica\Core\Lock\ILock;
 use Friendica\Database\Database;
 use Friendica\Test\Util\VFSTrait;
@@ -32,8 +32,8 @@ class dependencyCheck extends TestCase
 
                $this->setUpVfsDir();
 
-               $this->dice = new Dice();
-               $this->dice = $this->dice->addRules(include __DIR__ . '/../../static/dependencies.config.php');
+               $this->dice = (new Dice())
+                       ->addRules(include __DIR__ . '/../../static/dependencies.config.php');
        }
 
        /**
@@ -87,7 +87,7 @@ class dependencyCheck extends TestCase
                ]);
 
                // create new DI-library because of shared instance rule (so the Profiler wouldn't get created twice)
-               $this->dice = new Dice(include __DIR__ . '/../../static/dependencies.config.php');
+               $this->dice = new Dice();
                $profiler = $this->dice->create(Profiler::class, [$configCache]);
 
                $this->assertInstanceOf(Profiler::class, $profiler);
@@ -115,10 +115,10 @@ class dependencyCheck extends TestCase
 
        public function testConfiguration()
        {
-               /** @var Configuration $config */
-               $config = $this->dice->create(Configuration::class);
+               /** @var IConfiguration $config */
+               $config = $this->dice->create(IConfiguration::class);
 
-               $this->assertInstanceOf(Configuration::class, $config);
+               $this->assertInstanceOf(IConfiguration::class, $config);
 
                $this->assertNotEmpty($config->get('database', 'username'));
        }
@@ -133,6 +133,10 @@ class dependencyCheck extends TestCase
 
        public function testDevLogger()
        {
+               /** @var IConfiguration $config */
+               $config = $this->dice->create(IConfiguration::class);
+               $config->set('system', 'dlogfile', $this->root->url() . '/friendica.log');
+
                /** @var LoggerInterface $logger */
                $logger = $this->dice->create('$devLogger', ['dev']);