diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-11-15 14:39:12 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-11-15 14:39:12 -0500 |
commit | a42f1ea2bd0e208a67ac42a956f3a0bc366256de (patch) | |
tree | a1bea6bfb97f56fea14867c80c71a49650380d83 /app/Action/TaskAssignCategoryLink.php | |
parent | 2011c3534401f8aa8b4e4b72f0a024e58ca85560 (diff) |
Add unit test for TaskAssignCategoryLink
Diffstat (limited to 'app/Action/TaskAssignCategoryLink.php')
-rw-r--r-- | app/Action/TaskAssignCategoryLink.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/Action/TaskAssignCategoryLink.php b/app/Action/TaskAssignCategoryLink.php index 8398facf..3d00e8d3 100644 --- a/app/Action/TaskAssignCategoryLink.php +++ b/app/Action/TaskAssignCategoryLink.php @@ -9,6 +9,7 @@ use Kanboard\Model\TaskLink; * * @package action * @author Olivier Maridat + * @author Frederic Guillot */ class TaskAssignCategoryLink extends Base { @@ -35,7 +36,7 @@ class TaskAssignCategoryLink extends Base { return array( 'category_id' => t('Category'), - 'link_id' => t('Link id'), + 'link_id' => t('Link type'), ); } @@ -79,6 +80,11 @@ class TaskAssignCategoryLink extends Base */ public function hasRequiredCondition(array $data) { - return $data['link_id'] == $this->getParam('link_id'); + if ($data['link_id'] == $this->getParam('link_id')) { + $task = $this->taskFinder->getById($data['task_id']); + return empty($task['category_id']); + } + + return false; } } |