]> git.mxchange.org Git - friendica.git/commitdiff
Bugfixing tests
authorPhilipp Holzer <admin@philipp.info>
Sun, 3 Feb 2019 21:53:39 +0000 (22:53 +0100)
committerPhilipp Holzer <admin@philipp.info>
Sun, 3 Feb 2019 21:53:39 +0000 (22:53 +0100)
src/Database/DBA.php
tests/DatabaseTest.php

index dc3c62abeac94b463429840f19f317ddebe46b8a..eaeeb9cbddc34450376b2f5a821745fdf592372c 100644 (file)
@@ -423,7 +423,7 @@ class DBA
 
                $orig_sql = $sql;
 
-               if (self::$config->get('system', 'db_callstack')) {
+               if (self::$config->get('system', 'db_callstack') !== null) {
                        $sql = "/*".System::callstack()." */ ".$sql;
                }
 
index 69ee750dbca389b6dab7cabbe693ce4d59dddd95..79af5b5468a9495f86d390ceda58d1afdc4d64eb 100644 (file)
@@ -5,7 +5,10 @@
 
 namespace Friendica\Test;
 
+use Friendica\Core\Config;
 use Friendica\Database\DBA;
+use Friendica\Factory;
+use Friendica\Util\BasePath;
 use PHPUnit\DbUnit\DataSet\YamlDataSet;
 use PHPUnit\DbUnit\TestCaseTrait;
 use PHPUnit_Extensions_Database_DB_IDatabaseConnection;
@@ -36,8 +39,12 @@ abstract class DatabaseTest extends MockedTest
                        $this->markTestSkipped('Please set the MYSQL_* environment variables to your test database credentials.');
                }
 
+               $basedir = BasePath::create(dirname(__DIR__));
+               $configLoader = new Config\ConfigCacheLoader($basedir);
+               $config = Factory\ConfigFactory::createCache($configLoader);
+
                DBA::connect(
-                       __DIR__,
+                       $config,
                        getenv('MYSQL_HOST'),
                        getenv('MYSQL_USERNAME'),
                        getenv('MYSQL_PASSWORD'),