From 9722cf61520b166454ab7b4cda5b610d56f1fa77 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Wed, 12 Mar 2014 21:18:38 -0400 Subject: Add unit tests for automatic actions --- actions/task_duplicate_another_project.php | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'actions/task_duplicate_another_project.php') diff --git a/actions/task_duplicate_another_project.php b/actions/task_duplicate_another_project.php index 31089c67..e898f757 100644 --- a/actions/task_duplicate_another_project.php +++ b/actions/task_duplicate_another_project.php @@ -4,14 +4,33 @@ namespace Action; require_once __DIR__.'/base.php'; +/** + * Duplicate a task to another project + * + * @package action + * @author Frederic Guillot + */ class TaskDuplicateAnotherProject extends Base { + /** + * Constructor + * + * @access public + * @param integer $project_id Project id + * @param Task $task Task model instance + */ public function __construct($project_id, \Model\Task $task) { parent::__construct($project_id); $this->task = $task; } + /** + * Get the required parameter for the action (defined by the user) + * + * @access public + * @return array + */ public function getActionRequiredParameters() { return array( @@ -20,6 +39,12 @@ class TaskDuplicateAnotherProject extends Base ); } + /** + * Get the required parameter for the event + * + * @access public + * @return array + */ public function getEventRequiredParameters() { return array( @@ -29,6 +54,13 @@ class TaskDuplicateAnotherProject extends Base ); } + /** + * Execute the action + * + * @access public + * @param array $data Event data dictionary + * @return bool True if the action was executed or false when not executed + */ public function doAction(array $data) { if ($data['column_id'] == $this->getParam('column_id') && $data['project_id'] != $this->getParam('project_id')) { -- cgit v1.2.3