c5cbf565d9
* Adding DBStructure enhancements - Added DBStructure::rename() - Added DBStructure::existTable() - Added DBStructure::existColumn() (cherry picked from commit 4ae06ec) * Adding `pre_update_1279` method - Added DBStructure::rename() - Added DBStructure::existTable() - Added DBStructure::existColumn() (cherry picked from commit 8496d84) * code standards (cherry picked from commit 551d09b) * simplify to `empty` instead `is_null` (cherry picked from commit ce68835)
41 lines
980 B
PHP
41 lines
980 B
PHP
<?php
|
|
namespace Friendica\Test\Database;
|
|
|
|
use Friendica\BaseObject;
|
|
use Friendica\Core\Config;
|
|
use Friendica\Database\DBA;
|
|
use Friendica\Test\DatabaseTest;
|
|
|
|
class DBATest extends DatabaseTest
|
|
{
|
|
public function setUp()
|
|
{
|
|
parent::setUp();
|
|
|
|
// Reusable App object
|
|
$this->app = BaseObject::getApp();
|
|
|
|
// Default config
|
|
Config::set('config', 'hostname', 'localhost');
|
|
Config::set('system', 'throttle_limit_day', 100);
|
|
Config::set('system', 'throttle_limit_week', 100);
|
|
Config::set('system', 'throttle_limit_month', 100);
|
|
Config::set('system', 'theme', 'system_theme');
|
|
}
|
|
|
|
/**
|
|
* @small
|
|
*/
|
|
public function testExists() {
|
|
|
|
$this->assertTrue(DBA::exists('config', []));
|
|
$this->assertFalse(DBA::exists('notable', []));
|
|
|
|
$this->assertTrue(DBA::exists('config', null));
|
|
$this->assertFalse(DBA::exists('notable', null));
|
|
|
|
$this->assertTrue(DBA::exists('config', ['k' => 'hostname']));
|
|
$this->assertFalse(DBA::exists('config', ['k' => 'nonsense']));
|
|
}
|
|
}
|