From 15038cdb10f8c691edc7980fd1aed32dcbed3f9f Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sat, 22 Nov 2014 10:05:44 -0500 Subject: Move task creation to a seperate class --- tests/units/TaskPermissionTest.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tests/units/TaskPermissionTest.php') diff --git a/tests/units/TaskPermissionTest.php b/tests/units/TaskPermissionTest.php index 426941ce..963864b2 100644 --- a/tests/units/TaskPermissionTest.php +++ b/tests/units/TaskPermissionTest.php @@ -3,6 +3,7 @@ require_once __DIR__.'/Base.php'; use Model\Task; +use Model\TaskCreation; use Model\TaskFinder; use Model\TaskPermission; use Model\Project; @@ -13,7 +14,7 @@ class TaskPermissionTest extends Base { public function testPrepareCreation() { - $t = new Task($this->container); + $tc = new TaskCreation($this->container); $tf = new TaskFinder($this->container); $tp = new TaskPermission($this->container); $p = new Project($this->container); @@ -22,10 +23,10 @@ class TaskPermissionTest extends Base $this->assertTrue($u->create(array('username' => 'toto', 'password' => '123456'))); $this->assertTrue($u->create(array('username' => 'toto2', 'password' => '123456'))); $this->assertEquals(1, $p->create(array('name' => 'Project #1'))); - $this->assertEquals(1, $t->create(array('title' => 'Task #1', 'project_id' => 1, 'creator_id' => 1))); - $this->assertEquals(2, $t->create(array('title' => 'Task #2', 'project_id' => 1, 'creator_id' => 2))); - $this->assertEquals(3, $t->create(array('title' => 'Task #3', 'project_id' => 1, 'creator_id' => 3))); - $this->assertEquals(4, $t->create(array('title' => 'Task #4', 'project_id' => 1))); + $this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1, 'creator_id' => 1))); + $this->assertEquals(2, $tc->create(array('title' => 'Task #2', 'project_id' => 1, 'creator_id' => 2))); + $this->assertEquals(3, $tc->create(array('title' => 'Task #3', 'project_id' => 1, 'creator_id' => 3))); + $this->assertEquals(4, $tc->create(array('title' => 'Task #4', 'project_id' => 1))); // User #1 can remove everything $user = $u->getbyId(1); -- cgit v1.2.3