summaryrefslogtreecommitdiff
path: root/tests/units/TaskFinderTest.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-09-05 23:30:56 -0400
committerFrederic Guillot <fred@kanboard.net>2015-09-05 23:30:56 -0400
commit710f2c7bb046b43ec9878ae795a181101f6d7515 (patch)
treeb62723b6b49c3b6bf2b3ca41a772f552464a9031 /tests/units/TaskFinderTest.php
parent94b38dd94bd819168163003beec8ef693f9d9839 (diff)
Improve unit tests
Diffstat (limited to 'tests/units/TaskFinderTest.php')
-rw-r--r--tests/units/TaskFinderTest.php33
1 files changed, 0 insertions, 33 deletions
diff --git a/tests/units/TaskFinderTest.php b/tests/units/TaskFinderTest.php
deleted file mode 100644
index 96a3809b..00000000
--- a/tests/units/TaskFinderTest.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-require_once __DIR__.'/Base.php';
-
-use Model\Task;
-use Model\TaskCreation;
-use Model\TaskFinder;
-use Model\Project;
-use Model\ProjectPermission;
-use Model\Category;
-use Model\User;
-
-class TaskFinderTest extends Base
-{
- public function testGetOverdueTasks()
- {
- $tc = new TaskCreation($this->container);
- $tf = new TaskFinder($this->container);
- $p = new Project($this->container);
-
- $this->assertEquals(1, $p->create(array('name' => 'Project #1')));
- $this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1, 'date_due' => strtotime('-1 day'))));
- $this->assertEquals(2, $tc->create(array('title' => 'Task #2', 'project_id' => 1, 'date_due' => strtotime('+1 day'))));
- $this->assertEquals(3, $tc->create(array('title' => 'Task #3', 'project_id' => 1, 'date_due' => 0)));
- $this->assertEquals(4, $tc->create(array('title' => 'Task #3', 'project_id' => 1)));
-
- $tasks = $tf->getOverdueTasks();
- $this->assertNotEmpty($tasks);
- $this->assertTrue(is_array($tasks));
- $this->assertEquals(1, count($tasks));
- $this->assertEquals('Task #1', $tasks[0]['title']);
- }
-}