Add tags parameter to task API calls

This commit is contained in:
Frederic Guillot
2016-12-18 18:19:25 -05:00
parent bc5641da8b
commit 2decbe28b5
3 changed files with 47 additions and 16 deletions

View File

@@ -12,6 +12,8 @@ class TaskTagProcedureTest extends BaseProcedureTest
$this->assertCreateTask();
$this->assertSetTaskTags();
$this->assertGetTaskTags();
$this->assertCreateTaskWithTags();
$this->assertUpdateTaskWithTags();
}
public function assertSetTaskTags()
@@ -24,4 +26,29 @@ class TaskTagProcedureTest extends BaseProcedureTest
$tags = $this->app->getTaskTags($this->taskId);
$this->assertEquals(array('tag1', 'tag2'), array_values($tags));
}
public function assertCreateTaskWithTags()
{
$this->taskId = $this->app->createTask(array(
'title' => $this->taskTitle,
'project_id' => $this->projectId,
'tags' => array('tag A', 'tag B'),
));
$this->assertNotFalse($this->taskId);
$tags = $this->app->getTaskTags($this->taskId);
$this->assertEquals(array('tag A', 'tag B'), array_values($tags));
}
public function assertUpdateTaskWithTags()
{
$this->assertTrue($this->app->updateTask(array(
'id' => $this->taskId,
'tags' => array('tag C'),
)));
$tags = $this->app->getTaskTags($this->taskId);
$this->assertEquals(array('tag C'), array_values($tags));
}
}