summaryrefslogtreecommitdiff
path: root/tests/integration/TaskTest.php
diff options
context:
space:
mode:
authorImbasaur <yarrusg@gmail.com>2016-04-29 15:20:48 +0200
committerImbasaur <yarrusg@gmail.com>2016-04-29 15:20:48 +0200
commit7459bc1c40af72441ccdaff944ef2dc9465ba9bf (patch)
treefea088cdda93079aee9e719a1bbe8464358efbb0 /tests/integration/TaskTest.php
parent99f275e5bb033cca33eee87b0e914645730f13d1 (diff)
parent81a25cbe6328eab7c4de0befc64186610ecc7f49 (diff)
Merge pull request #2 from fguillot/master
merge
Diffstat (limited to 'tests/integration/TaskTest.php')
-rw-r--r--tests/integration/TaskTest.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/integration/TaskTest.php b/tests/integration/TaskTest.php
index 6d500da4..0c398761 100644
--- a/tests/integration/TaskTest.php
+++ b/tests/integration/TaskTest.php
@@ -4,6 +4,42 @@ 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');
+ $this->assertNotFalse($project_id);
+
+ $task_id = $this->app->createTask(array('project_id' => $project_id, 'title' => 'My task', 'priority' => 2));
+
+ $task = $this->app->getTask($task_id);
+ $this->assertEquals(2, $task['priority']);
+
+ $this->assertTrue($this->app->updateTask(array('id' => $task_id, 'project_id' => $project_id, 'priority' => 3)));
+
+ $task = $this->app->getTask($task_id);
+ $this->assertEquals(3, $task['priority']);
+ }
+
public function testChangeAssigneeToAssignableUser()
{
$project_id = $this->app->createProject('My project');