2 namespace Friendica\Test\src\Database;
5 use Friendica\BaseObject;
6 use Friendica\Core\Config;
7 use Friendica\Database\DBA;
8 use Friendica\Test\DatabaseTest;
10 class DBATest extends DatabaseTest
12 public function setUp()
17 $dice = $dice->addRules(include __DIR__ . '/../../../static/dependencies.config.php');
18 BaseObject::setDependencyInjection($dice);
21 Config::set('config', 'hostname', 'localhost');
22 Config::set('system', 'throttle_limit_day', 100);
23 Config::set('system', 'throttle_limit_week', 100);
24 Config::set('system', 'throttle_limit_month', 100);
25 Config::set('system', 'theme', 'system_theme');
31 public function testExists() {
33 $this->assertTrue(DBA::exists('config', []));
34 $this->assertFalse(DBA::exists('notable', []));
36 $this->assertTrue(DBA::exists('config', null));
37 $this->assertFalse(DBA::exists('notable', null));
39 $this->assertTrue(DBA::exists('config', ['k' => 'hostname']));
40 $this->assertFalse(DBA::exists('config', ['k' => 'nonsense']));