]> git.mxchange.org Git - friendica.git/blob - tests/src/Database/DBATest.php
17ac55fd7a5bd58d031b5fdf609c09647c018aec
[friendica.git] / tests / src / Database / DBATest.php
1 <?php
2 namespace Friendica\Test\Database;
3
4 use Friendica\BaseObject;
5 use Friendica\Core\Config;
6 use Friendica\Database\DBA;
7 use Friendica\Test\DatabaseTest;
8
9 class DBATest extends DatabaseTest
10 {
11         public function setUp()
12         {
13                 parent::setUp();
14
15                 // Reusable App object
16                 $this->app = BaseObject::getApp();
17
18                 // Default config
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');
24         }
25
26         /**
27          * @small
28          */
29         public function testExists() {
30
31                 $this->assertTrue(DBA::exists('config', []));
32                 $this->assertFalse(DBA::exists('notable', []));
33
34                 $this->assertTrue(DBA::exists('config', null));
35                 $this->assertFalse(DBA::exists('notable', null));
36
37                 $this->assertTrue(DBA::exists('config', ['k' => 'hostname']));
38                 $this->assertFalse(DBA::exists('config', ['k' => 'nonsense']));
39         }
40 }