From d1bfc29f1b738b396e4fb9befa9b49c24f4e9249 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 19 Jul 2015 14:14:05 -0400 Subject: Add settings option to define the default task color --- tests/units/TaskCreationTest.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tests/units') 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']); + } } -- cgit v1.2.3