summaryrefslogtreecommitdiff
path: root/tests/functionals/ApiTest.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-09-18 22:37:00 -0400
committerFrederic Guillot <fred@kanboard.net>2015-09-18 22:37:00 -0400
commite8228c3975bb7cf2179d2ba670aa55d3e7780f3c (patch)
tree8f5ce7b8fd5c465b2dc4f1128fc82be93665f919 /tests/functionals/ApiTest.php
parent1fa72295f20aa9794f1b33dfde95960c34d85366 (diff)
Add some tests
Diffstat (limited to 'tests/functionals/ApiTest.php')
-rw-r--r--tests/functionals/ApiTest.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/functionals/ApiTest.php b/tests/functionals/ApiTest.php
index 284c31b9..17741771 100644
--- a/tests/functionals/ApiTest.php
+++ b/tests/functionals/ApiTest.php
@@ -1055,4 +1055,31 @@ class Api extends PHPUnit_Framework_TestCase
$this->assertEquals('TICKET-1234', $task['reference']);
$this->assertEquals('http://127.0.0.1:8000/?controller=task&action=show&task_id='.$task['id'].'&project_id='.$task['project_id'], $task['url']);
}
+
+ public function testCreateOverdueTask()
+ {
+ $this->assertNotFalse($this->client->createTask(array(
+ 'title' => 'overdue task',
+ 'project_id' => 1,
+ 'date_due' => date('Y-m-d', strtotime('-2days')),
+ )));
+ }
+
+ public function testGetOverdueTasksByProject()
+ {
+ $tasks = $this->client->getOverdueTasksByProject(1);
+ $this->assertNotEmpty($tasks);
+ $this->assertCount(1, $tasks);
+ $this->assertEquals('overdue task', $tasks[0]['title']);
+ $this->assertEquals('API test', $tasks[0]['project_name']);
+ }
+
+ public function testGetOverdueTasks()
+ {
+ $tasks = $this->client->getOverdueTasks();
+ $this->assertNotEmpty($tasks);
+ $this->assertCount(1, $tasks);
+ $this->assertEquals('overdue task', $tasks[0]['title']);
+ $this->assertEquals('API test', $tasks[0]['project_name']);
+ }
} \ No newline at end of file