From da1725c225c94bcdffe4dba4c068db8e1e11cbe7 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Fri, 22 Apr 2016 18:49:19 -0400 Subject: Added searchTasks API procedure --- tests/integration/TaskTest.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests/integration') diff --git a/tests/integration/TaskTest.php b/tests/integration/TaskTest.php index 39fe41bf..0c398761 100644 --- a/tests/integration/TaskTest.php +++ b/tests/integration/TaskTest.php @@ -4,6 +4,26 @@ require_once __DIR__.'/Base.php'; class TaskTest extends Base { + public function testSearchTasks() + { + $project_id1 = $this->app->createProject('My project'); + $project_id2 = $this->app->createProject('My project'); + $this->assertNotFalse($project_id1); + $this->assertNotFalse($project_id2); + + $this->assertNotFalse($this->app->createTask(array('project_id' => $project_id1, 'title' => 'T1'))); + $this->assertNotFalse($this->app->createTask(array('project_id' => $project_id1, 'title' => 'T2'))); + $this->assertNotFalse($this->app->createTask(array('project_id' => $project_id2, 'title' => 'T3'))); + + $tasks = $this->app->searchTasks($project_id1, 't2'); + $this->assertCount(1, $tasks); + $this->assertEquals('T2', $tasks[0]['title']); + + $tasks = $this->app->searchTasks(array('project_id' => $project_id2, 'query' => 'assignee:nobody')); + $this->assertCount(1, $tasks); + $this->assertEquals('T3', $tasks[0]['title']); + } + public function testPriorityAttribute() { $project_id = $this->app->createProject('My project'); -- cgit v1.2.3