summaryrefslogtreecommitdiff
path: root/tests/units/ConfigTest.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-09-12 17:35:48 +0200
committerFrédéric Guillot <fred@kanboard.net>2014-09-12 17:35:48 +0200
commit2e6a8d435f4fa73882224b465716360ee2e7c693 (patch)
tree9839a499905c350cd02d56454a25b90a79ede41f /tests/units/ConfigTest.php
parentc3a0cf43430438bfe7e7b0ccccfadb72a74331d6 (diff)
Add settings field to control project columns (pull-request #244)
Diffstat (limited to 'tests/units/ConfigTest.php')
-rw-r--r--tests/units/ConfigTest.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/units/ConfigTest.php b/tests/units/ConfigTest.php
new file mode 100644
index 00000000..7298936e
--- /dev/null
+++ b/tests/units/ConfigTest.php
@@ -0,0 +1,32 @@
+<?php
+
+require_once __DIR__.'/Base.php';
+
+use Model\Config;
+
+class ConfigTest extends Base
+{
+ public function testDefaultValues()
+ {
+ $c = new Config($this->registry);
+
+ $this->assertEquals('en_US', $c->get('language'));
+ $this->assertEquals('UTC', $c->get('timezone'));
+
+ $this->assertEmpty($c->get('webhooks_url_task_modification'));
+ $this->assertEmpty($c->get('webhooks_url_task_creation'));
+ $this->assertEmpty($c->get('default_columns'));
+
+ $this->assertNotEmpty($c->get('webhooks_token'));
+ $this->assertNotEmpty($c->get('api_token'));
+ }
+
+ public function testGet()
+ {
+ $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));
+ }
+}