diff options
Diffstat (limited to 'tests/units')
-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']); + } } |