diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-09-16 17:54:17 +0200 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-09-16 17:54:17 +0200 |
commit | eb6dfdca533bc18d8e1b1bdf4d4505c41d9b9c13 (patch) | |
tree | f44b4fa5fba0f75021a5bfb144daf821585c17b8 /tests/units | |
parent | a76939066b01b9dd39ff44a8d3aa3165dc7b3eaf (diff) |
Improve API calls for comments
Diffstat (limited to 'tests/units')
-rw-r--r-- | tests/units/CommentTest.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/units/CommentTest.php b/tests/units/CommentTest.php index fa790555..31c46996 100644 --- a/tests/units/CommentTest.php +++ b/tests/units/CommentTest.php @@ -47,6 +47,8 @@ class CommentTest extends Base $this->assertEquals(1, $comments[0]['id']); $this->assertEquals(2, $comments[1]['id']); $this->assertEquals(3, $comments[2]['id']); + + $this->assertEquals(3, $c->count(1)); } public function testUpdate() @@ -65,6 +67,21 @@ class CommentTest extends Base $this->assertEquals('bla', $comment['comment']); } + public function validateRemove() + { + $c = new Comment($this->registry); + $t = new Task($this->registry); + $p = new Project($this->registry); + + $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->assertTrue($c->create(array('task_id' => 1, 'comment' => 'c1', 'user_id' => 1))); + + $this->assertTrue($c->remove(1)); + $this->assertFalse($c->remove(1)); + $this->assertFalse($c->remove(1111)); + } + public function testValidateCreation() { $c = new Comment($this->registry); |