summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-04-22 18:49:19 -0400
committerFrederic Guillot <fred@kanboard.net>2016-04-22 18:49:19 -0400
commitda1725c225c94bcdffe4dba4c068db8e1e11cbe7 (patch)
tree8e52c9e16faa88bb5931a6a39cde86219c61b0e9 /tests
parent756716766cb33da2c25544918574368b51cca26e (diff)
Added searchTasks API procedure
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/TaskTest.php20
1 files changed, 20 insertions, 0 deletions
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');