diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-07-19 14:14:05 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-07-19 14:14:05 -0400 |
commit | d1bfc29f1b738b396e4fb9befa9b49c24f4e9249 (patch) | |
tree | fa41906a61007c0893ca7ab238ed52f853bb452f /tests | |
parent | 9eeb7d18201ad817d8c5eb88995a48c5bd44d22a (diff) |
Add settings option to define the default task color
Diffstat (limited to 'tests')
-rw-r--r-- | tests/units/TaskCreationTest.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/units/TaskCreationTest.php b/tests/units/TaskCreationTest.php index 03a85b64..2dc67ad4 100644 --- a/tests/units/TaskCreationTest.php +++ b/tests/units/TaskCreationTest.php @@ -2,6 +2,7 @@ require_once __DIR__.'/Base.php'; +use Model\Config; use Model\Task; use Model\TaskCreation; use Model\TaskFinder; @@ -383,4 +384,27 @@ class TaskCreationTest extends Base $this->assertNotFalse($task); $this->assertEquals(3, $task['score']); } + + public function testDefaultColor() + { + $p = new Project($this->container); + $tc = new TaskCreation($this->container); + $tf = new TaskFinder($this->container); + $c = new Config($this->container); + + $this->assertEquals(1, $p->create(array('name' => 'test'))); + $this->assertEquals(1, $tc->create(array('project_id' => 1, 'title' => 'test1'))); + + $task = $tf->getById(1); + $this->assertNotEmpty($task); + $this->assertEquals('yellow', $task['color_id']); + + $this->assertTrue($c->save(array('default_color' => 'orange'))); + + $this->assertEquals(2, $tc->create(array('project_id' => 1, 'title' => 'test2'))); + + $task = $tf->getById(2); + $this->assertNotEmpty($task); + $this->assertEquals('orange', $task['color_id']); + } } |