summaryrefslogtreecommitdiff
path: root/tests/integration/TaskProcedureTest.php
diff options
context:
space:
mode:
authori00171 <anton.delitsch@implema.se>2016-06-26 18:35:25 +0200
committeri00171 <anton.delitsch@implema.se>2016-06-26 18:35:25 +0200
commit47039d32c84ba699867920d2c3cb47a34b199b9d (patch)
tree4fbc2ec34889baeab00085e0509055dca7daee6a /tests/integration/TaskProcedureTest.php
parent911be6ed00c1ece5d9ef2c16e80899bb7bffad67 (diff)
parentc110dffefe259c13e60193fb81ebb9d4b79504de (diff)
Merge branch 'master' of https://github.com/fguillot/kanboard
Diffstat (limited to 'tests/integration/TaskProcedureTest.php')
-rw-r--r--tests/integration/TaskProcedureTest.php55
1 files changed, 55 insertions, 0 deletions
diff --git a/tests/integration/TaskProcedureTest.php b/tests/integration/TaskProcedureTest.php
new file mode 100644
index 00000000..f456ae52
--- /dev/null
+++ b/tests/integration/TaskProcedureTest.php
@@ -0,0 +1,55 @@
+<?php
+
+require_once __DIR__.'/BaseProcedureTest.php';
+
+class TaskProcedureTest extends BaseProcedureTest
+{
+ protected $projectName = 'My project to test tasks';
+
+ public function testAll()
+ {
+ $this->assertCreateTeamProject();
+ $this->assertCreateTask();
+ $this->assertUpdateTask();
+ $this->assertGetTaskById();
+ $this->assertGetTaskByReference();
+ $this->assertGetAllTasks();
+ $this->assertOpenCloseTask();
+ }
+
+ public function assertUpdateTask()
+ {
+ $this->assertTrue($this->app->updateTask(array('id' => $this->taskId, 'color_id' => 'red')));
+ }
+
+ public function assertGetTaskById()
+ {
+ $task = $this->app->getTask($this->taskId);
+ $this->assertNotNull($task);
+ $this->assertEquals('red', $task['color_id']);
+ $this->assertEquals($this->taskTitle, $task['title']);
+ }
+
+ public function assertGetTaskByReference()
+ {
+ $taskId = $this->app->createTask(array('title' => 'task with reference', 'project_id' => $this->projectId, 'reference' => 'test'));
+ $this->assertNotFalse($taskId);
+
+ $task = $this->app->getTaskByReference($this->projectId, 'test');
+ $this->assertNotNull($task);
+ $this->assertEquals($taskId, $task['id']);
+ }
+
+ public function assertGetAllTasks()
+ {
+ $tasks = $this->app->getAllTasks($this->projectId);
+ $this->assertInternalType('array', $tasks);
+ $this->assertNotEmpty($tasks);
+ }
+
+ public function assertOpenCloseTask()
+ {
+ $this->assertTrue($this->app->closeTask($this->taskId));
+ $this->assertTrue($this->app->openTask($this->taskId));
+ }
+}