diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-10-12 15:32:35 -0400 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-10-12 15:32:35 -0400 |
commit | 4061927d215c846ff8eb196301bf61532018042b (patch) | |
tree | 0e14a0e458ee8739754f75f8c158cc42a9b593a4 /tests/units/CategoryTest.php | |
parent | b7060b33ef317eeac576c504b1fb840d4471e411 (diff) |
Move some Task model methods to the TaskFinder class
Diffstat (limited to 'tests/units/CategoryTest.php')
-rw-r--r-- | tests/units/CategoryTest.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/units/CategoryTest.php b/tests/units/CategoryTest.php index 201fa589..ef061419 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\TaskFinder; use Model\Project; use Model\Category; use Model\User; @@ -12,6 +13,7 @@ class CategoryTest extends Base public function testCreation() { $t = new Task($this->registry); + $tf = new TaskFinder($this->registry); $p = new Project($this->registry); $c = new Category($this->registry); @@ -20,7 +22,7 @@ class CategoryTest extends Base $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))); - $task = $t->getById(1); + $task = $tf->getById(1); $this->assertTrue(is_array($task)); $this->assertEquals(2, $task['category_id']); @@ -34,6 +36,7 @@ class CategoryTest extends Base public function testRemove() { $t = new Task($this->registry); + $tf = new TaskFinder($this->registry); $p = new Project($this->registry); $c = new Category($this->registry); @@ -42,7 +45,7 @@ class CategoryTest extends Base $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))); - $task = $t->getById(1); + $task = $tf->getById(1); $this->assertTrue(is_array($task)); $this->assertEquals(2, $task['category_id']); @@ -50,7 +53,7 @@ class CategoryTest extends Base $this->assertTrue($c->remove(2)); // Make sure tasks assigned with that category are reseted - $task = $t->getById(1); + $task = $tf->getById(1); $this->assertTrue(is_array($task)); $this->assertEquals(0, $task['category_id']); } |