From 9d4cd31e1aae02e9980932c67036fdfe574e3432 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Thu, 9 Aug 2018 21:35:11 +0200 Subject: Allow to associate tags to colors The color is then used as background in the board, list and task details views --- tests/units/Formatter/BoardFormatterTest.php | 3 +++ tests/units/Formatter/TaskListFormatterTest.php | 5 ++++- tests/units/Model/TagModelTest.php | 3 ++- tests/units/Model/TaskTagModelTest.php | 10 +++++++--- 4 files changed, 16 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/units/Formatter/BoardFormatterTest.php b/tests/units/Formatter/BoardFormatterTest.php index 1b0ace1d..7b90eb00 100644 --- a/tests/units/Formatter/BoardFormatterTest.php +++ b/tests/units/Formatter/BoardFormatterTest.php @@ -375,11 +375,13 @@ class BoardFormatterTest extends Base 'id' => 1, 'name' => 'My tag 1', 'task_id' => 1, + 'color_id' => null, ), array( 'id' => 2, 'name' => 'My tag 2', 'task_id' => 1, + 'color_id' => null, ), ); @@ -391,6 +393,7 @@ class BoardFormatterTest extends Base 'id' => 3, 'name' => 'My tag 3', 'task_id' => 2, + 'color_id' => null, ), ); diff --git a/tests/units/Formatter/TaskListFormatterTest.php b/tests/units/Formatter/TaskListFormatterTest.php index a6e44d38..d079ed7e 100644 --- a/tests/units/Formatter/TaskListFormatterTest.php +++ b/tests/units/Formatter/TaskListFormatterTest.php @@ -37,11 +37,13 @@ class TaskListFormatterTest extends Base 'id' => 1, 'name' => 'My tag 1', 'task_id' => 1, + 'color_id' => null, ), array( 'id' => 2, 'name' => 'My tag 2', 'task_id' => 1, + 'color_id' => null, ), ); @@ -52,10 +54,11 @@ class TaskListFormatterTest extends Base 'id' => 3, 'name' => 'My tag 3', 'task_id' => 2, + 'color_id' => null, ), ); $this->assertEquals($expected, $listing[1]['tags']); $this->assertEquals(array(), $listing[2]['tags']); } -} \ No newline at end of file +} diff --git a/tests/units/Model/TagModelTest.php b/tests/units/Model/TagModelTest.php index f090ab4a..46151a8c 100644 --- a/tests/units/Model/TagModelTest.php +++ b/tests/units/Model/TagModelTest.php @@ -111,10 +111,11 @@ class TagModelTest extends Base { $tagModel = new TagModel($this->container); $this->assertEquals(1, $tagModel->create(0, 'Tag 1')); - $this->assertTrue($tagModel->update(1, 'Tag Updated')); + $this->assertTrue($tagModel->update(1, 'Tag Updated', 'purple')); $tag = $tagModel->getById(1); $this->assertEquals(0, $tag['project_id']); $this->assertEquals('Tag Updated', $tag['name']); + $this->assertEquals('purple', $tag['color_id']); } } diff --git a/tests/units/Model/TaskTagModelTest.php b/tests/units/Model/TaskTagModelTest.php index 32158952..f83bb05a 100644 --- a/tests/units/Model/TaskTagModelTest.php +++ b/tests/units/Model/TaskTagModelTest.php @@ -86,17 +86,20 @@ class TaskTagModelTest extends Base array( 'id' => 1, 'name' => 'My tag 1', - 'task_id' => 1 + 'task_id' => 1, + 'color_id' => null, ), array( 'id' => 2, 'name' => 'My tag 2', - 'task_id' => 1 + 'task_id' => 1, + 'color_id' => null, ), array( 'id' => 3, 'name' => 'My tag 3', - 'task_id' => 1 + 'task_id' => 1, + 'color_id' => null, ), ), 2 => array( @@ -104,6 +107,7 @@ class TaskTagModelTest extends Base 'id' => 3, 'name' => 'My tag 3', 'task_id' => 2, + 'color_id' => null, ) ) ); -- cgit v1.2.3