diff options
Diffstat (limited to 'tests/units/CommentTest.php')
-rw-r--r-- | tests/units/CommentTest.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/units/CommentTest.php b/tests/units/CommentTest.php index 36ff1352..295ac60e 100644 --- a/tests/units/CommentTest.php +++ b/tests/units/CommentTest.php @@ -17,16 +17,24 @@ class CommentTest extends Base $this->assertEquals(1, $p->create(array('name' => 'test1'))); $this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 3, 'owner_id' => 1))); - $this->assertNotFalse($c->create(array('task_id' => 1, 'comment' => 'bla bla', 'user_id' => 1))); + $this->assertEquals(1, $c->create(array('task_id' => 1, 'comment' => 'bla bla', 'user_id' => 1))); + $this->assertEquals(2, $c->create(array('task_id' => 1, 'comment' => 'bla bla'))); $comment = $c->getById(1); - $this->assertNotEmpty($comment); $this->assertEquals('bla bla', $comment['comment']); $this->assertEquals(1, $comment['task_id']); $this->assertEquals(1, $comment['user_id']); $this->assertEquals('admin', $comment['username']); - $this->assertNotEmpty($comment['date']); + $this->assertEquals(time(), $comment['date_creation'], '', 3); + + $comment = $c->getById(2); + $this->assertNotEmpty($comment); + $this->assertEquals('bla bla', $comment['comment']); + $this->assertEquals(1, $comment['task_id']); + $this->assertEquals(0, $comment['user_id']); + $this->assertEquals('', $comment['username']); + $this->assertEquals(time(), $comment['date_creation'], '', 3); } public function testGetAll() @@ -103,7 +111,7 @@ class CommentTest extends Base $this->assertFalse($result[0]); $result = $c->validateCreation(array('task_id' => 1, 'comment' => 'bla')); - $this->assertFalse($result[0]); + $this->assertTrue($result[0]); $result = $c->validateCreation(array('comment' => 'bla')); $this->assertFalse($result[0]); |