summaryrefslogtreecommitdiff
path: root/tests/units/CategoryTest.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/CategoryTest.php
parent8f0e544cd91b24423951bbb5d3f3be0950a63abe (diff)
Move task creation to a seperate class
Diffstat (limited to 'tests/units/CategoryTest.php')
-rw-r--r--tests/units/CategoryTest.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/units/CategoryTest.php b/tests/units/CategoryTest.php
index e7452d26..f169e961 100644
--- a/tests/units/CategoryTest.php
+++ b/tests/units/CategoryTest.php
@@ -3,6 +3,7 @@
require_once __DIR__.'/Base.php';
use Model\Task;
+use Model\TaskCreation;
use Model\TaskFinder;
use Model\Project;
use Model\Category;
@@ -12,7 +13,7 @@ class CategoryTest extends Base
{
public function testCreation()
{
- $t = new Task($this->container);
+ $tc = new TaskCreation($this->container);
$tf = new TaskFinder($this->container);
$p = new Project($this->container);
$c = new Category($this->container);
@@ -20,7 +21,7 @@ class CategoryTest extends Base
$this->assertEquals(1, $p->create(array('name' => 'Project #1')));
$this->assertEquals(1, $c->create(array('name' => 'Category #1', 'project_id' => 1)));
$this->assertEquals(2, $c->create(array('name' => 'Category #2', 'project_id' => 1)));
- $this->assertEquals(1, $t->create(array('title' => 'Task #1', 'project_id' => 1, 'category_id' => 2)));
+ $this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1, 'category_id' => 2)));
$task = $tf->getById(1);
$this->assertTrue(is_array($task));
@@ -35,7 +36,7 @@ class CategoryTest extends Base
public function testRemove()
{
- $t = new Task($this->container);
+ $tc = new TaskCreation($this->container);
$tf = new TaskFinder($this->container);
$p = new Project($this->container);
$c = new Category($this->container);
@@ -43,7 +44,7 @@ class CategoryTest extends Base
$this->assertEquals(1, $p->create(array('name' => 'Project #1')));
$this->assertEquals(1, $c->create(array('name' => 'Category #1', 'project_id' => 1)));
$this->assertEquals(2, $c->create(array('name' => 'Category #2', 'project_id' => 1)));
- $this->assertEquals(1, $t->create(array('title' => 'Task #1', 'project_id' => 1, 'category_id' => 2)));
+ $this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1, 'category_id' => 2)));
$task = $tf->getById(1);
$this->assertTrue(is_array($task));