diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-11-22 10:05:44 -0500 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-11-22 10:05:44 -0500 |
commit | 15038cdb10f8c691edc7980fd1aed32dcbed3f9f (patch) | |
tree | ebdf873e5c65616c3fd36ea2c7a449da52a61877 /tests/units/CommentTest.php | |
parent | 8f0e544cd91b24423951bbb5d3f3be0950a63abe (diff) |
Move task creation to a seperate class
Diffstat (limited to 'tests/units/CommentTest.php')
-rw-r--r-- | tests/units/CommentTest.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/units/CommentTest.php b/tests/units/CommentTest.php index f784382a..8846c0b8 100644 --- a/tests/units/CommentTest.php +++ b/tests/units/CommentTest.php @@ -3,6 +3,7 @@ require_once __DIR__.'/Base.php'; use Model\Task; +use Model\TaskCreation; use Model\Project; use Model\Comment; @@ -11,11 +12,11 @@ class CommentTest extends Base public function testCreate() { $c = new Comment($this->container); - $t = new Task($this->container); + $tc = new TaskCreation($this->container); $p = new Project($this->container); $this->assertEquals(1, $p->create(array('name' => 'test1'))); - $this->assertEquals(1, $t->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 3, 'owner_id' => 1))); + $this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 3, 'owner_id' => 1))); $this->assertTrue($c->create(array('task_id' => 1, 'comment' => 'bla bla', 'user_id' => 1))); $comment = $c->getById(1); @@ -31,11 +32,11 @@ class CommentTest extends Base public function testGetAll() { $c = new Comment($this->container); - $t = new Task($this->container); + $tc = new TaskCreation($this->container); $p = new Project($this->container); $this->assertEquals(1, $p->create(array('name' => 'test1'))); - $this->assertEquals(1, $t->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 3, 'owner_id' => 1))); + $this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 3, 'owner_id' => 1))); $this->assertTrue($c->create(array('task_id' => 1, 'comment' => 'c1', 'user_id' => 1))); $this->assertTrue($c->create(array('task_id' => 1, 'comment' => 'c2', 'user_id' => 1))); $this->assertTrue($c->create(array('task_id' => 1, 'comment' => 'c3', 'user_id' => 1))); @@ -54,11 +55,11 @@ class CommentTest extends Base public function testUpdate() { $c = new Comment($this->container); - $t = new Task($this->container); + $tc = new TaskCreation($this->container); $p = new Project($this->container); $this->assertEquals(1, $p->create(array('name' => 'test1'))); - $this->assertEquals(1, $t->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 3, 'owner_id' => 1))); + $this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 3, 'owner_id' => 1))); $this->assertTrue($c->create(array('task_id' => 1, 'comment' => 'c1', 'user_id' => 1))); $this->assertTrue($c->update(array('id' => 1, 'comment' => 'bla'))); @@ -70,11 +71,11 @@ class CommentTest extends Base public function validateRemove() { $c = new Comment($this->container); - $t = new Task($this->container); + $tc = new TaskCreation($this->container); $p = new Project($this->container); $this->assertEquals(1, $p->create(array('name' => 'test1'))); - $this->assertEquals(1, $t->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 3, 'owner_id' => 1))); + $this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 3, 'owner_id' => 1))); $this->assertTrue($c->create(array('task_id' => 1, 'comment' => 'c1', 'user_id' => 1))); $this->assertTrue($c->remove(1)); |