summaryrefslogtreecommitdiff
path: root/tests/units/TaskFinderTest.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-11-22 10:05:44 -0500
committerFrédéric Guillot <fred@kanboard.net>2014-11-22 10:05:44 -0500
commit15038cdb10f8c691edc7980fd1aed32dcbed3f9f (patch)
treeebdf873e5c65616c3fd36ea2c7a449da52a61877 /tests/units/TaskFinderTest.php
parent8f0e544cd91b24423951bbb5d3f3be0950a63abe (diff)
Move task creation to a seperate class
Diffstat (limited to 'tests/units/TaskFinderTest.php')
-rw-r--r--tests/units/TaskFinderTest.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/units/TaskFinderTest.php b/tests/units/TaskFinderTest.php
index 96454f22..96a3809b 100644
--- a/tests/units/TaskFinderTest.php
+++ b/tests/units/TaskFinderTest.php
@@ -3,6 +3,7 @@
require_once __DIR__.'/Base.php';
use Model\Task;
+use Model\TaskCreation;
use Model\TaskFinder;
use Model\Project;
use Model\ProjectPermission;
@@ -13,15 +14,15 @@ class TaskFinderTest extends Base
{
public function testGetOverdueTasks()
{
- $t = new Task($this->container);
+ $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, $t->create(array('title' => 'Task #1', 'project_id' => 1, 'date_due' => strtotime('-1 day'))));
- $this->assertEquals(2, $t->create(array('title' => 'Task #2', 'project_id' => 1, 'date_due' => strtotime('+1 day'))));
- $this->assertEquals(3, $t->create(array('title' => 'Task #3', 'project_id' => 1, 'date_due' => 0)));
- $this->assertEquals(4, $t->create(array('title' => 'Task #3', 'project_id' => 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);