Add unit tests for automatic actions
This commit is contained in:
@@ -4,8 +4,22 @@ namespace Action;
|
||||
|
||||
require_once __DIR__.'/base.php';
|
||||
|
||||
/**
|
||||
* Assign a task to the logged user
|
||||
*
|
||||
* @package action
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class TaskAssignCurrentUser extends Base
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @access public
|
||||
* @param integer $project_id Project id
|
||||
* @param Task $task Task model instance
|
||||
* @param Acl $acl Acl model instance
|
||||
*/
|
||||
public function __construct($project_id, \Model\Task $task, \Model\Acl $acl)
|
||||
{
|
||||
parent::__construct($project_id);
|
||||
@@ -13,6 +27,12 @@ class TaskAssignCurrentUser extends Base
|
||||
$this->acl = $acl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the required parameter for the action (defined by the user)
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getActionRequiredParameters()
|
||||
{
|
||||
return array(
|
||||
@@ -20,6 +40,12 @@ class TaskAssignCurrentUser extends Base
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the required parameter for the event
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getEventRequiredParameters()
|
||||
{
|
||||
return array(
|
||||
@@ -28,6 +54,13 @@ class TaskAssignCurrentUser 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')) {
|
||||
|
||||
Reference in New Issue
Block a user