From eb6dfdca533bc18d8e1b1bdf4d4505c41d9b9c13 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Tue, 16 Sep 2014 17:54:17 +0200 Subject: Improve API calls for comments --- tests/units/CommentTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/units') 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); -- cgit v1.2.3