2 namespace Friendica\Test\Database;
4 use Friendica\BaseObject;
5 use Friendica\Core\Config;
6 use Friendica\Database\DBA;
7 use Friendica\Test\DatabaseTest;
9 class DBATest extends DatabaseTest
11 public function setUp()
15 // Reusable App object
16 $this->app = BaseObject::getApp();
19 Config::set('config', 'hostname', 'localhost');
20 Config::set('system', 'throttle_limit_day', 100);
21 Config::set('system', 'throttle_limit_week', 100);
22 Config::set('system', 'throttle_limit_month', 100);
23 Config::set('system', 'theme', 'system_theme');
29 public function testExists() {
31 $this->assertTrue(DBA::exists('config', []));
32 $this->assertFalse(DBA::exists('notable', []));
34 $this->assertTrue(DBA::exists('config', null));
35 $this->assertFalse(DBA::exists('notable', null));
37 $this->assertTrue(DBA::exists('config', ['k' => 'hostname']));
38 $this->assertFalse(DBA::exists('config', ['k' => 'nonsense']));