From 9283fb88d80cb355ff98364a9a57b657fc511d98 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 17 Oct 2015 15:27:43 -0400 Subject: Add metadata for users, tasks and projects --- tests/units/Model/ConfigTest.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'tests/units/Model/ConfigTest.php') diff --git a/tests/units/Model/ConfigTest.php b/tests/units/Model/ConfigTest.php index 7670daac..17617ceb 100644 --- a/tests/units/Model/ConfigTest.php +++ b/tests/units/Model/ConfigTest.php @@ -7,6 +7,31 @@ use Kanboard\Core\Session; class ConfigTest extends Base { + public function testCRUDOperations() + { + $c = new Config($this->container); + + $this->assertTrue($c->save(array('key1' => 'value1'))); + $this->assertTrue($c->save(array('key1' => 'value2'))); + $this->assertTrue($c->save(array('key2' => 'value2'))); + + $this->assertEquals('value2', $c->getOption('key1')); + $this->assertEquals('value2', $c->getOption('key2')); + $this->assertEquals('', $c->getOption('key3')); + $this->assertEquals('default', $c->getOption('key3', 'default')); + + $this->assertTrue($c->exists('key1')); + $this->assertFalse($c->exists('key3')); + + $this->assertTrue($c->save(array('key1' => 'value1'))); + + $this->assertArrayHasKey('key1', $c->getAll()); + $this->assertArrayHasKey('key2', $c->getAll()); + + $this->assertContains('value1', $c->getAll()); + $this->assertContains('value2', $c->getAll()); + } + public function testSaveApplicationUrl() { $c = new Config($this->container); -- cgit v1.2.3