Improve settings page and move some config parameters to the database
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<php>
|
||||
<const name="API_URL" value="http://localhost:8000/jsonrpc.php" />
|
||||
<const name="API_URL" value="http://localhost:8080/jsonrpc.php" />
|
||||
<const name="API_KEY" value="19ffd9709d03ce50675c3a43d1c49c1ac207f4bc45f06c5b2701fbdf8929" />
|
||||
<const name="DB_DRIVER" value="mysql" />
|
||||
<const name="DB_NAME" value="kanboard" />
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<php>
|
||||
<const name="API_URL" value="http://localhost:8000/jsonrpc.php" />
|
||||
<const name="API_URL" value="http://localhost:8080/jsonrpc.php" />
|
||||
<const name="API_KEY" value="19ffd9709d03ce50675c3a43d1c49c1ac207f4bc45f06c5b2701fbdf8929" />
|
||||
<const name="DB_DRIVER" value="postgres" />
|
||||
<const name="DB_NAME" value="kanboard" />
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<php>
|
||||
<const name="API_URL" value="http://localhost:8000/jsonrpc.php" />
|
||||
<const name="API_URL" value="http://localhost:8080/jsonrpc.php" />
|
||||
<const name="API_KEY" value="19ffd9709d03ce50675c3a43d1c49c1ac207f4bc45f06c5b2701fbdf8929" />
|
||||
<const name="DB_DRIVER" value="sqlite" />
|
||||
<const name="DB_FILENAME" value="data/db.sqlite" />
|
||||
|
||||
@@ -30,7 +30,7 @@ class Api extends PHPUnit_Framework_TestCase
|
||||
|
||||
setup_db();
|
||||
|
||||
$pdo->exec("UPDATE config SET api_token='".API_KEY."'");
|
||||
$pdo->exec("UPDATE settings SET value='".API_KEY."' WHERE option='api_token'");
|
||||
$pdo = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,8 +27,10 @@ class BoardTest extends Base
|
||||
$this->assertEquals('Done', $columns[4]);
|
||||
|
||||
// Custom columns: spaces should be trimed and no empty columns
|
||||
$input = ' column #1 , column #2, ';
|
||||
|
||||
$this->assertTrue($c->save(array('default_columns' => ' column #1 , column #2, ')));
|
||||
$this->assertTrue($c->save(array('board_columns' => $input)));
|
||||
$this->assertEquals($input, $c->get('board_columns'));
|
||||
|
||||
$this->assertEquals(2, $p->create(array('name' => 'UnitTest2')));
|
||||
$columns = $b->getColumnsList(2);
|
||||
|
||||
@@ -10,14 +10,14 @@ class ConfigTest extends Base
|
||||
{
|
||||
$c = new Config($this->registry);
|
||||
|
||||
$this->assertEquals('en_US', $c->get('language'));
|
||||
$this->assertEquals('UTC', $c->get('timezone'));
|
||||
$this->assertEquals('en_US', $c->get('application_language'));
|
||||
$this->assertEquals('UTC', $c->get('application_timezone'));
|
||||
|
||||
$this->assertEmpty($c->get('webhooks_url_task_modification'));
|
||||
$this->assertEmpty($c->get('webhooks_url_task_creation'));
|
||||
$this->assertEmpty($c->get('default_columns'));
|
||||
$this->assertEmpty($c->get('webhook_url_task_modification'));
|
||||
$this->assertEmpty($c->get('webhook_url_task_creation'));
|
||||
$this->assertEmpty($c->get('board_columns'));
|
||||
|
||||
$this->assertNotEmpty($c->get('webhooks_token'));
|
||||
$this->assertNotEmpty($c->get('webhook_token'));
|
||||
$this->assertNotEmpty($c->get('api_token'));
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ class ConfigTest extends Base
|
||||
{
|
||||
$c = new Config($this->registry);
|
||||
|
||||
$this->assertEquals('', $c->get('default_columns'));
|
||||
$this->assertEquals('test', $c->get('default_columns', 'test'));
|
||||
$this->assertEquals(0, $c->get('default_columns', 0));
|
||||
$this->assertEquals('', $c->get('board_columns'));
|
||||
$this->assertEquals('test', $c->get('board_columns', 'test'));
|
||||
$this->assertEquals(0, $c->get('board_columns', 0));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user